I need to use two different <liferay-ui:search-container> tags in a single JSP.
The pagination gives issues if we use two <liferay-ui:search-container> tags:
-
When I click on the 3rd page of the first
<liferay-ui:search-container>tag the second<liferay-ui:search-container>tag also moves to the third page. -
Also if for the first
<liferay-ui:search-container>tag I am on page-3 and I click page-2 of second<liferay-ui:search-container>tag then the second tag goes to page-2 but the first tag results is reset to page-1.
They should be independent of each other.
Environment: Liferay 6.+
I found two different ways to do this:
This is possible through the use of
curParamattribute in<liferay-ui:search-container>tag, noticed thecurParam="folderCurParam"andcurParam="fileCurParam"in the following code, I found this way through liferay’s source codedocroot/html/portlet/document_library_display/view.jspanddocroot/html/portlet/document_library_display/view_file_entries.jspf:I found this again in liferay’s source code
docroot/html/portlet/journal/select_document_library.jsp, this uses theSearchContainerconstructor to set thecurParam, notice the parameter"cur1"for folders and for files it is"cur2":Hope this helps someone.