2009/6/24 Przemysław Wojnowski <przemyslaw.wojnow...@nask.pl>:
> Hi!

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?

As offset = startIndex and limit = endIndex - startIndex + 1, I think
their interchangeable for most scenarios.

> 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).

I guess getAvailableRows() is used for calculating the number of pages
and then display the pager.

> 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.

Please file a JIRA about this. Maybe we could use some special return
value in GridDataSource.getAvailableRows() to indicate that it is not
available yet and then call it again after GridDataSource.prepare(),
thus solving your problem.

-- 
Thiago

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

Reply via email to