Hi Mike,

The issue is that DataPage is something that the business tier needs to deal with. And business tier code (eg EJBs) really should not be returning objects descended from a JSF implementation.

Well, at least the business tier needs some mechanism to return (datasetsize, offset, datalist) as the result of a query, and DataPage is perfect for that as long as it is *not* descended from an org.apache.myfaces class. This problem doesn't pop up for "standard" data tables, because the java standard collection classes can be used to transfer data from business to presentation tiers; alas there isn't any standard class to represent a "page" of data from a larger collection. Maybe someone could propose java.util.Sublist as a new collection class?

I suppose that users could write their own DataPage-like class for the business tier, then in the web tier create a DataPage from it.

Or maybe if we got a "Sublist" type into commons-collections then that would be ok for business tiers to use, and the PagedListDataModel could accept one of those instead of a DataPage.

I do think some kind of "paging" DataModel implementation would be nice in tomahawk, but I'm just not sure what the best way to structure things are in order to avoid business-tier --> JSF dependency.

Regards,

Simon

Mike Kienenberger wrote:
Hey Simon,

Is there any reason why we can't make DataPage an interface, and put
the rest of the supporting classes into myfaces as
org.apache.myfaces.model.*?

Other than converting it back to Java 1.4, that is :)

-Mike


On 11/28/05, Yee CN <[EMAIL PROTECTED]> wrote:
Thanks for the beautiful solution. It works like a charm in conjunciton with
"Select ... Limit startRow, pageSize" for getting the exact number of rows
and "Select count(*) ..." for getting the size of the dataset.

It will take me a while more to understand the inner workings. But thanks
again.

Best regards,
Yee

-----Original Message-----
From: Simon Kitching [mailto:[EMAIL PROTECTED]
Sent: Monday, 28 November 2005 10:19 AM
To: MyFaces Discussion
Subject: Re: dataTable, t:dataScroller and large datasets

Hi,

For all those interested in this thread, I've come up with a solution
that suits me, and have added it to a page on the wiki; see
"WorkingWithLargeTables" in the HowTo section on the main page.

Regards,

Simon




Reply via email to