13 September, 2012

Liferay search container without database

If you want to use search container in which data will come from Array rather than database,
you can simply use below code :

            results="<%= stringList %>"
            total="<%= stringList.size() %>"



   List<String> testList = new ArrayList<String>();
   for(int i=0;i<=50;i++)
       testList.add("String " + i);
       <liferay-ui:search-container delta="10" emptyResultsMessage="No Items were found!!">
        <liferay-ui:search-container-results results="<%=ListUtil.subList(testList, searchContainer.getStart(), searchContainer.getEnd())%>" total="${testList.size()}" />
        <liferay-ui:search-container-row className="String" modelVar="data">
            <liferay-ui:search-container-column-text name="name" value="<%=data %>" />

Popular Posts

Featured Post

Liferay 7.3 compatibility matrix

Compatibility Matrix Liferay's general policy is to test Liferay Portal CE against newer major releases of operating systems, open s...