Hi,

I am creating a PagedLoop component that is able to use Grid's paging
infrastructure directly. Are you interested in including such component in
Tapestry corelib (a question is primarily for Howard and other relevant
people here)?

Here is an explanation why such component is preferable to t5components'
PageLoop and even useful for minor improvement/generalization of Grid's
infrastructure (can be implemented even without changing GridDataSource but
read on):

1 (the main reason): In plain old HTML, Table (T5 Grid) should be used for
displaying natural tabulated data, NOT for visual layouting of listings (CSS
is preferred for such purpose, if you do not understand what I am talking
about, see http://www.google.com/search?q=html+presentation+css+vs+table).
Therefore, Loop should be the first choice if we want to display some
business entity's details. Current Loop can do just that except that it does
not support pagination. So, if you want pagination, you should use
t5components' PagedLoop or fall back to Grid.

2. t5c's PagedLoop has two major problems:
a) it duplicates the whole Pager/DataSource infrastructure. For default
purposes it is not an issue, but if you need to implement on-demand
retrieval of paginated database data on your own you can not reuse the
PersistentDataSource that you created for the Grid (and it is an issue in
real world apps).
b) even if you do not mind duplicated persistent source, t5c's PAgedLoop has
major flaws - it does not support DataSource interface that you could
implement. It displays only ordinary Iterable. Moreover, PagedSource that it
provides is neither interface, nor used in the actual code. So you're stuck
with inefficient display of ordinary collections/lists, which may be ok for
many situations but a real dealbreaker for others.

3. How this can be improved:
a) refactor t5c's PagedLoop to use Grid's infrastructure (GridDataSource and
GridPager). I have already done a prototype of this for my aplication, and
it was, surprisingly, pretty easy. The one thing that still needs to be
solved is how to elegantly extract one page of data from GridDataSource to
supply it as the Loop's source.
b) It can be done outside of the DataSource, bu shouldn't it be better if we
improve GridDataSource to support Iterable? Of course, that can be put in a
subclass of GridDataSource, but one DataSource interface for both Loops and
Grids would be simpler and cleaner.

So, to summarize, I would implement this for my application, and I wont to
know are you interested to add such implementation into core Tapestry? Of
course, if anybody have an idea how to make it even simpler, please add your
suggestions... 

I you are interested, please help me or point the information on how to do
it (necessary procedure, tests etc.).
-- 
View this message in context: 
http://www.nabble.com/Better-%28more-generic%29-paging-for-Grid-AND-Loop.-Interested-in-adding-it-to-Tapestry--tp18933731p18933731.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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

Reply via email to