Foren

Example of liferay-ui:search-container in Liferay 7

Marco Núñez Arrieta, geändert vor 8 Jahren.

Example of liferay-ui:search-container in Liferay 7

New Member Beiträge: 10 Beitrittsdatum: 03.09.12 Neueste Beiträge
Hi!
Can someone share an example of liferay-ui:search-container with Liferay 7 OSGi mvcportlet, because it is not the same approach as in 6.2 version.

I'm trying to implement a user directory portlet showing some user defined fields, but I'm not able to use the liferay-ui:search-container approach in Liferay 7.

Thanks!
thumbnail
Harish Kumar, geändert vor 7 Jahren.

RE: Example of liferay-ui:search-container in Liferay 7

Expert Beiträge: 483 Beitrittsdatum: 31.07.10 Neueste Beiträge
Hi

Following is code snippet to implement search container in Liferay 7


<% PortletURL iteratorURL = renderResponse.createRenderURL();
List<book> bookList = (List<book>)request.getAttribute("bookList");
%&gt;

<p>
	<b><liferay-ui:message key="book_list" /></b>
</p>

<liferay-ui:search-container delta="2" emptyresultsmessage="No Books Found!!" iteratorurl="<%=iteratorURL%>">
	<liferay-ui:search-container-results results="<%= ListUtil.subList(bookList, searchContainer.getStart(), searchContainer.getEnd()) %>" />
	<liferay-ui:search-container-row classname="com.harish.sample.model.Book" keyproperty="bookId" modelvar="book">
		<liferay-ui:search-container-column-text name="Title" value="${book.title}" />
		<liferay-ui:search-container-column-text name="Author" value="${book.author}" />
		<liferay-ui:search-container-column-text name="ISBN" value="${book.isbn}" />
		&lt;%-- <liferay-ui:search-container-column-jsp path="/WEB-INF/jsp/studentActions.jsp" align="right" /> --%&gt;
	</liferay-ui:search-container-row>
	<liferay-ui:search-iterator />
</liferay-ui:search-container>
</book></book>


Regards,
Harish