Hello,
I've been trying to use the woodstock table component with a result set
whose size is initially indeterminate. I'm hoping to render the first page
of data initially, and have additional pages become accessible as the data
for them is retrieved.
Does anybody have any ideas on how I might go about doing this, or even if
it's a good idea to use the table component for this?
I've gotten most of the way there by doing the following:
Implementing a custom TableDataProvider for my data which returns row counts
according to the currently available rows.
Implementing a custom TableDataSorter that re-runs my back end query with
the new sort, and always returns the first page's RowKeys (basically
swapping the first page within the data provider to match the new first page
for the sort, since you can't render in sorted order from memory when it's
not all loaded).
Using Javascript and AJAX to enable/disable the next/last page buttons as
appropriate depending on what pages are available.
It seems a bit crazy, but everything pretty much works. The last problem
I'm dealing with is that when the next/last page button is clicked the first
time, the table can only advance to a page that was available when the table
was first rendered, even if there's more data accessible. I've tried
clearing out the cached RowKeys in my TableRowGroup, but the initial RowKeys
from the first rendering are restored from state on any paging action, and
only the pages represented by those first RowKeys are available before the
table is re-rendered once.
So what typically happens is that the table will render initially with two
pages available. When the last page is available and I enable the last page
button, clicking it only takes you to the second page (the table was
initially rendered with two pages' worth of RowKeys). After that all pages
are available and everything works fine, it's just the first paging action
doesn't work quite right.
I have considered using custom paging controls, and may try that route if I
can't figure out how to work with the built-in controls.
Thanks for any ideas.
--
View this message in context: http://www.nabble.com/Table-with-incomplete-data--tp14284585p14284585.html
Sent from the Project Woodstock - Users mailing list archive at Nabble.com.