liferayspring-portlet-mvc

Liferay search container in Spring MVC portlets


Is it possible to use Liferay search container in spring portlets? when i tried, nothing is rendering in the page. i have enclosed the code. am just adding the data in session and trying to show in search container.

<%
     final PortletSession sessData = renderRequest.getPortletSession();
     List<Detail> details = (List<Detail>) sessData.getAttribute("DETAILS",PortletSession.PORTLET_SCOPE);
%>


<liferay-ui:search-container delta="3" emptyResultsMessage="No Details found" headerNames="User ID, First Name, Last Name, Address">
<%
    int numOfRecords = details.size();                                  
%>

    <liferay-ui:search-container-results results="<%= details %>" total="${numOfRecords}">

    </liferay-ui:search-container-results>

    <liferay-ui:search-container-row className="Detail" modelVar="detailData">
        <liferay-ui:search-container-column-text name="User ID" property="userId" />
        <liferay-ui:search-container-column-text name="First Name" property="firstName" />
        <liferay-ui:search-container-column-text name="Last Name" property="lastName" />
        <liferay-ui:search-container-column-text name="Address" property="address" />
    </liferay-ui:search-container-row>
</liferay-ui:search-container>

Solution

  • I missed to add the search-iterator.

    <liferay-ui:search-iterator searchContainer="<%=searchContainer%>"
               paginate="<%=isNeeded%>" />