incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Winer" <>
Subject Re: tr:table & pagin
Date Mon, 11 Dec 2006 16:45:59 GMT
On 12/11/06, Marcus Bond <> wrote:
> From what I can gather, in Trinidad the total number of records in a table
> is automatically 'known' by the  number of rows in the model. However, what
> if you don't want to fetch the whole set of data from the database and would
> prefer to only fetch the required rows from the database for each page?

No, not the case.  Just like in Tomahawk and with h:dataTable,
we support the DataModel API.  If you don't know how many rows
there are, then return -1 from getRowCount().  The only requirement -
which applies to all users of the JSF DataModel API - is that if
someone calls setRowIndex(...), isRowAvailable() has to figure
out if that row really exists.

The Trinidad CollectionModel API extends DataModel to add support
for sorting and identifying-rows-by-keys-instead-of-indices - but
the same rules apply.  So you could extend CollectionModel instead
of DataModel if you want those add-on features, but we support
both DataModel and CollectionModel.

-- Adam

> I only want to query for a small number of records (1 page) at a time but
> need some way of informing the table component that there are in fact a lot
> more records in the database.
> This would require setting a variable that represents the total number of
> rows available from the database, but there doesn't appear any longer to be
> this facility.
> Is there a straightforward way of doing this? (eg: like the dataScroller in
> tomahawk)
> thanks,
> Marcus
> _________________________________________________________________
> It's Hotmail's 10th Birthday! Come and play Pass the Parcel

View raw message