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 %>" />

Rate Me:

2 Discussion:

James McCarthy said...

The site was absolutely fantastic! Lots of great information and inspiration, both of which we all need!b Keep 'em coming... you all do such a great job at such Concepts... can't tell you how much I, for one appreciate all you do!

AimIT Software - software company

Jignesh Vachhani said...

Thanks James