You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by "skip@thedevers" <sk...@thedevers.org> on 2008/03/21 02:17:56 UTC

FTL / EntityListIterator Question

I have this ftl script that displays a list from an EntityListIterator.
This ftl script has a link on the primary key in the list to display a
second ftl screen showing the details of the fields in the selected
GenericValue from the EntityListIterator.

I have a request to be able to click a button from this detail screen and
show the next or previous record from the EntityListIterator, and thereby
move through the list a record at a time from the detail screen.  I am
passing the id field as a parameter to the detail screen and do a
findByPrimaryKey() to get the detail.  I can't see any
GenericDelegator.findNext() or anything like it which would be exactly what
I need.  The entity can sometimes contain a million records so I would
prefer not to get all the keys and then search through them, especially
considering that I have an active EntityListIterator.

Anyone have any ideas about how to do this?  I could load all the keys into
an array and then do a binary search for the passed in key and then get the
next or previous, but that seems like a lot of overhead unless I could keep
this list and position from one request to the next.

Doing this with a fat-client app would be trivial.    I cannot see an
elegant way of doing it with a web-app.

Skip
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.21.7/1333 - Release Date: 3/18/2008
8:10 AM