Hi!
Why Grid#setupDataSource() is calculating endIndex and not allowing for
GridDataSource to do it? Why GridDataSource#prepare method have
startIndex and endIndex parameters and not offset/limit pair?

I'm asking, because if GridDataSource could calculate endIndex (or use
limit instead) for itself, then there would be no need to call
getAvailableRows() before prepare(), which is a problem (at least IMHO).
Then Grid#setupDataSource() could look like this:

void setupDataSource()
{
    cachingSource = new CachingDataSource(source);
    int startIndex = (getCurrentPage()-1) * rowsPerPage;
    cachingSource.prepare(startIndex, startIndex+rowsPerPage,
sortModel.getSortConstraints());
}

This would allow for single-call (those which receive number of
available rows, columns definitions, and columns values in one expensive
call) datasources to work.

Best regards,
Przemysław Wojnowski


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to