0
votes

I am creating web application for booking tickets. After querying from DB for given inputs now i have 230 records (ticket informations) which has been added to list ,as objects (pojo's) .in JSF i am using "ui:repeat" to iterate the list. Here got confused how to create pagination on this. (i want to display 40 records /page). I should not hit the backend for each and every "NEXT" or "PREVIOUS" click .. Any help would be thankful.

Note: when i hit search button my flow will navigate to result.jsf page where i passed the 230 records for display. Technology: Spring web flow and JSF 2

1
I hope this answer could help - landal79
If you don't want to perform ajax requests when next-previous clicking, you'll need to use javascript to hide/show each page. You'll probably need to play with ui:repeat's varStatus properties to assign-locate page id's and you'll also need an h:panelGroup or a div in order to wrap each page's content. - Xtreme Biker

1 Answers

-1
votes

simplest solution is to use PrimeFaces DataTable Pagination or equivalent without reinventing the wheel