Next/previous object

I have a listview from which a user can go to a detail page for each object. I would like to add two buttons -next and previous- so that the user can view the next or previous object from the listview without having to navigate back to the overview page. I figured I could retrieve a list of the objects and find the index of the current object, and show the same page for 'Index of current object +1' but I can't seem to find a good way of doing this. Ideas?
3 answers

Does your listview have an attribute it's sorted on?

If so, you could use that same attribute in a retrieve action.

For example, if you have an Order object with an attribute OrderId, you could do a retrieve with an xPath constraint

Set the sorting to OrderId, and select Range: First, so you only retrieve 1 object instead of a list.

Now you will get the first Order that has an orderId greater then the OrderId of your current Order: i.e. the 'next' order.

For the previous object you could use the same logic, but use < and set sorting to Descending.

But be carefull with using this on an editable page, as it might not be clear to the user that his changes might (not) be saved.


Also easy way is to use the listview and pagination widget. Set your listiview page size to 1


live demo here:



Should be possible as follows:

  1. Retrieve from database 
  2. Range: first
  3. XPath: index is < or > then currentobject/Index
  4. Sort on index ascending/descending (depending on next or previous)