Create a suitable SearchContainer in your controller and add it to your model. As Prakash K already said this SearchContainer might look like this:
SearchContainer<Book> searchContainer = new SearchContainer<Book>(renderRequest, renderResponse.createRenderURL(), null, "there are no books");
Due to the two parameters renderRequest and renderResponse, you cannot use the @ModelAttribute annotation to add SearchContainer as a model attribute.
Then the JSP can be written as follows:
<liferay-ui:search-container searchContainer="${model.searchContainer}" delta="${model.searchContainer.delta}" deltaParam="books_delta"> <liferay-ui:search-container-results results="${model.searchContainer.results}" total="${model.searchContainer.total}"/> <liferay-ui:search-container-row className="Book" keyProperty="primaryKey" modelVar="book"> ... </liferay-ui:search-container-row> <liferay-ui:search-iterator searchContainer="${model.searchContainer}"/> </liferay-ui:search-container>
The deltaParam attribute can be used to configure the URL parameter used.
source share