I would not perform an in-memory sort of the entire collection you are
attempting to page, as in your example.  One benefit of paging is not having
to return the entire dataset from the backend.  If your company has hundreds
or thousands of users, this will become a performance issue.

In the example I posted, the backend returns the paged set of users in the
correct sort order, based on the specified page, pageSize, sort property and
asc/desc specifier:

return getUserService().findPage(page, pageSize, sp.getProperty(),
sp.isAscending()).iterator();

You can use your database specific syntax to retrieve a subset of rows (for
MySQL, you would use the "limit" function, etc.) OR if you are using
Hibernate or EJB3, use the Query object's setFirstResult() and
setMaxResult() methods.  Oops... you mentioned you are using IBatis, so take
the database-specific route.


Greg Dunn-3 wrote:
> 
> There is one glitch though, when I click a column header to resort, I'm
> only resorting the items that are in view on the current page, not the
> entire set.  That doesn't seem right, can it be rectified?
> 
 
-- 
View this message in context: 
http://www.nabble.com/DefaultDataTable-not-paging-correctly-tp16180335p16184993.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to