I have done this, and it works quite nicely.

Be warned though, the biggest bottle neck in this, is the loading of the
data from database.
So for best performance, you should read only one page's worth data at a
time from your DB
(in your case 500).

If you load the whole data, and use some thing like a list iterator, you
will not get any performance
benefit.

Unfortunately ANSI SQL has no syntax for pagination of results. So you have
2 choices.

1) Keep an open DB cursor , and retrieve as much data as you want per page
rendering. But this
ties your cursor to the user session. Not a very good idea.

2) Use the vendor specific way to get paginated results. Almost all major
vendors support pagination
of query results in their own idiosyncratic way.

If you go with approach 2, you can even use the
AjaxFallbackDefaultDataTable, which will do all the
pagination etc for you, and with AJAX to boost.
You only need to provide a SortableDataProvider, which implements the size()
and iterate(int lower, int upper) calls. 
Your size() call should fetch a total count of items. i.e. select count(*) 
and the iterate(int lower, int upper) should retrieve the query results
between lower and upper limit.
And with sortable data provider, you even get sorting for free. (I mean the
UI, you do have to write
the back end implementation your self).

For my case, I use iBatis for DB access, so it is really easy to write DB
Vendor specific queries and
yet retain the pagination abstraction. If I need to work with another DB , I
can easily swap the
pagination query part.

Hope this has helped.



PhilipJohnson wrote:
> 
> * Finally, when I am displaying Page 1 containing 500 rows (using
> something like 
> PageableListView), I'd like to only populate my model with rows 1-500 from
> my backing 
> store.  Let's say the user then clicks on Page 3: at that point, I'd like
> to go retrieve 
> rows 1001-1500 from my backing store and populate my model for rows
> 1001-1500.  How would 
> one go about doing this?  Would it be possible to kind of sketch out the
> approach for me?
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-design-tables-that-support-50-100K-rows--tp16737855p16743554.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