掲示板

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

8年前 に Marco Núñez Arrieta によって更新されました。

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

New Member 投稿: 10 参加年月日: 12/09/03 最新の投稿
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
7年前 に Harish Kumar によって更新されました。

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

Expert 投稿: 483 参加年月日: 10/07/31 最新の投稿
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