Lilianne E. Blaze wrote:
> Hello,
> Either they're designed for something else entirely, or I'm missing
> something :/
> Consider the following scenario: a table with a list of users. Suppose
> it's up to 10.000 users, and it's page size is 25. Each row contains
> some basic data, plus some data which is calculated as needed and has to
> be done on object-by-object basis.
> Now, if I got it right, a "normal" DataProvider would require to get
> everything from a db, then sort it, then provide only the current 25. Is
> that correct?
>
If you're working with CachedRowSetDataProvider, that should cache data
for rows currently in view. However, there are other types of providers
that do not require a database. For example, you could use an
ObjectArrayDataProvider or ObjectListDataProvider. (There are several
examples in the TLD docs for TableRowGroup, which are hosted live.) You
can even bind a List or Object array directly to the table; although,
these "normal" providers require all data to be present.
> After reading the source I believe I can write, relatively easy, a
> DataProvider which, for example, when asked for 26th object lazily loads
> objects 25-50, doing sorting and limiting to page size on JPA's
> entityManager, while never actually containing more than visible at the
> moment. But I'm feeling I'm reinventing the wheel here, there should be
> support for such scenario, and I just can't see it. What am I missing here?
>
John Baker responded to a 8/13 thread, labeled "Woodstock table with
Seam", which has links to Dataprovider information. Did you check that out?
Dan