You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ca...@usitc.gov on 2006/12/11 18:20:54 UTC
IBasicTableModel - calling getRowCount() before getCurrentPageRows()
I am using a variant of the contrib:table (it has pagination links above
and below the table) to render DB search results.
The search service is a proxy to a remote web service and uses Hibernate
to prepare, execute and process the SQL query. In its current form the
service supports pagination and expects an object that includes
information related to the page requested (e.g. give me the next 10
matching rows starting at row 11). The service will then return results
that not only contain the matching records (up to 10) but ALSO the total
count of matching records.
This was just fine for the original incarnation for the contrib:table
that did not use the IBasicTableModel. However, now I have run into an
issue relating to the separate getCurrentPageRows() and getRowCount()
methods.
It is my understanding that the order/frequency that these methods are
called is based on the position of various components on the page. The
way my pages are designed, getRowCount() will be called before
getCurrentPageRows().
In order to handle the early getRowCount() call I currently make a
request to the service API (e.g. get me 1 record starting at 1) to
determine the count. When getCurrentPageRows() is called I make the
page appropriate method call. To call this wasteful, might be an
understatement.
I could render the getRowCount() dependent components "after" the
getCurrentPageRows() component and do some DHTML/CSS chicanery to
visually reposition them. However, I would like to avoid this if
possible, since anything other than vanilla HTML tends to be more error
prone and more difficult to maintain.
Am I missing something?
Carlos
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org