[jboss-user] [JBoss Seam] - Re: @Factory & Pagination

Andy Gibson do-not-reply at jboss.com
Fri Dec 14 10:29:31 EST 2007


Hey Sven,

Well, here's the problem, the factory method needs to know what page you are on, and then return the results for that page. 

The first easy option is to use an EntityQuery which has the firstResult and maxResults, next, first, last, previous  and a bunch of other properties and methods to let you control the data.

You can roll your own, but then you find yourself writing a bunch of code that is the same as the existing EntityQuery object code.

The problem with the rich:dataScroller is that it works on the whole list at once. The EntityQuery queries the database for the number of rows in the result, and then only fetches the number of rows on a page.

You can set up params in pages.xml to pass from one page to the next the values of the current page so you have a stateless viewer as opposed to keeping all items in memory (or keep reloading them) for the data scroller.

Cheers,

Andy








View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112971#4112971

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112971



More information about the jboss-user mailing list