I am not sure if this is considered kosher . . . 

The ITablePagingState and ITableSortingState will be up to date prior to
rendering - they encapsulate all of the data passed into the
getCurrentPageRows() method.  I could provide these object directly to
my custom IBasicTableModel - it will invoke the service call once, and
cache the results to fulfill any subsequent invocations to getRowCount()
and getCurrentPageRows().

I don't know how modifying the tablesessionstate and tablesessionstore
managers will impact this.

Anyone have any thoughts?

Carlos

-----Original Message-----
From: Fernandez, Carlos 
Sent: Monday, December 11, 2006 12:21 PM
To: users@tapestry.apache.org
Subject: 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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

Reply via email to