How to show object one by one from the list in page
Hi All I have One use case in my project i.e i want to show the list of retrived objects one by one when user clicks on next button on page, I am retriving list of random objects from data base any one please suggestion, Thanks in advance.
I have three suggestions that might work:
Limit the number of objects that you can view to 1 in the list configurations.
Use a non-persistable object that tracks the offset of the list. When the user clicks ‘Next’ then the list offset moves to the next object.
Show one object on a page, and when ‘Next’ is clicked retrieve the next object. (In this way you would not be retrieving the entire list into the session, but only one object at a time)
Hope these suggestions help.
You can implement your logic as below:
You should have/add an Auto Number attribute to your main entity.
You need an object to keep track of the current number (Tracker in my example).
Every time you hit the Next button, use "Retrieve Objects" action to take one record (Range = First) from database with XPath like [Number > $Tracker/CurrentNumber]. Remember to set Sorting by Number ascending.
Increase the CurrentNumber attribute of the Tracker entity by 1 after a successful retrieval.