You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "G.Cholakov" <ge...@sirma.bg> on 2008/03/06 09:31:25 UTC

Trinidad's table range navigation control

Hi guys,

I'm using MyFaces Trinidad's table component and I have the next question:

Let's pretend I have a database table with hundred of thousands of rows. I
don't want to retrieve all rows in a bean's collection and put it to the
session, because it will be huge. Is there a way to retrieve the next
portion of rows only when the user navigates to it?

Thanks for your time!
-- 
View this message in context: http://www.nabble.com/Trinidad%27s-table-range-navigation-control-tp15868710p15868710.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Trinidad's table range navigation control

Posted by "simon.kitching@chello.at" <si...@chello.at>.
Here's an example of this with normal JSF tables:
  http://wiki.apache.org/myfaces/WorkingWithLargeTables

Max Starets schrieb:
> Georgi,
>
> I do not have an example unfortunately.
> I do not think you have to rely on rangeChangeListener, however.
> You can have a custom ColelctionModel implementation that fetches
> ranges of data "on demand"
> and returns -1 from getRowCount().
>
> Regards,
> Max Starets
>
> G.Cholakov wrote:
>> Thank you Max,
>> But the range navigation combo updates each time when the elements in
>> the
>> collection are updated.
>> My idea was when the next portion of elements is requested, to
>> retrieve them
>> from the database and to release the previous portion - on order to
>> have in
>> the collection only requested portion, not all requested portions
>> until now
>> - all this functionality in rangeChangeListener of the table, where the
>> collection is updated with new elements.
>> So I didn't understand how to do that. If you can point me to an
>> example it
>> would be great.
>>
>> Thank you
>>
>>
>>   
>
>


Re: Trinidad's table range navigation control

Posted by Max Starets <ma...@oracle.com>.
Georgi,

I do not have an example unfortunately.
I do not think you have to rely on rangeChangeListener, however.
You can have a custom ColelctionModel implementation that fetches ranges 
of data "on demand"
and returns -1 from getRowCount().

Regards,
Max Starets

G.Cholakov wrote:
> Thank you Max,
> But the range navigation combo updates each time when the elements in the
> collection are updated.
> My idea was when the next portion of elements is requested, to retrieve them
> from the database and to release the previous portion - on order to have in
> the collection only requested portion, not all requested portions until now
> - all this functionality in rangeChangeListener of the table, where the
> collection is updated with new elements.
> So I didn't understand how to do that. If you can point me to an example it
> would be great.
>
> Thank you
>
>
>   


Re: Trinidad's table range navigation control

Posted by "G.Cholakov" <ge...@sirma.bg>.
Thank you Max,
But the range navigation combo updates each time when the elements in the
collection are updated.
My idea was when the next portion of elements is requested, to retrieve them
from the database and to release the previous portion - on order to have in
the collection only requested portion, not all requested portions until now
- all this functionality in rangeChangeListener of the table, where the
collection is updated with new elements.
So I didn't understand how to do that. If you can point me to an example it
would be great.

Thank you


-- 
View this message in context: http://www.nabble.com/Trinidad%27s-table-range-navigation-control-tp15868710p15950740.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Trinidad's table range navigation control

Posted by Max Starets <ma...@oracle.com>.
Yes. If your CollectionModel returns -1 from getRowCount(), the UI will 
be updated
not to show the total. Once you page to the next range, the table will 
attempt to retrieve it.

Regards,
Max

G.Cholakov wrote:
> Hi guys,
>
> I'm using MyFaces Trinidad's table component and I have the next question:
>
> Let's pretend I have a database table with hundred of thousands of rows. I
> don't want to retrieve all rows in a bean's collection and put it to the
> session, because it will be huge. Is there a way to retrieve the next
> portion of rows only when the user navigates to it?
>
> Thanks for your time!
>