see wicketstuff.org/wicket13/repeater especially the dataview
examples. they utilize wicket's IDataProvider interface which is
designed for paging/sorting of database data.

-igor


On Wed, Apr 23, 2008 at 2:43 AM, Eyal Golan <[EMAIL PROTECTED]> wrote:
> Hi,
>  Can anyone give me an explanation about paging with DetachableModel?
>
>  My problem:
>  We have records in the DB that can be a-lot.
>  We also filter them sometimes.
>
>  someone in the company created a non-standard paging.
>  He doesn't use the Wicket's paging.
>
>  The iterator method of the DataProvider he created returns only the number
>  of elements that should be displayed in the current page.
>  Eg. suppose we decided we show 20 records per page.
>  The DataProvider keeps track on which page we're at.
>  Then he calculates the indexes of records.
>  It's done in getVisibleTickets() method.
>  int fromIndex = (currentPage - 1) * (ticketsPerPage);
>  int toIndex = ticketsPerPage;
>
>  And then he asks the DB for the records in this range (with the filter).
>  This is the size() method:
>     public int size() {
>         if ((visibleTickets == null) || (update)) {
>             getVisibleTickets();
>         }
>         return visibleTickets.size();
>     }
>
>  OK, I hope i was clear enough.
>  I know that it might be done using Wicket's library.
>  Can anyone explain?
>
>  Thanks
>  --
>  Eyal Golan
>  [EMAIL PROTECTED]
>
>  Visit: http://jvdrums.sourceforge.net/
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to