You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Josh Kamau <jo...@gmail.com> on 2011/02/24 20:53:42 UTC
pagination
Hi Users;
How does tapestry do the pagination on a grid? Does it retrieve all the data
from the database and then does the pagination on the clientside or does it
retrieve a page at a time from the database?
I have used wicket before and all i did was implement something like
getIterator(first, count, sortProperty, isAscending), That way, the way the
data is retrieved is transparent and i can write a dao that gets each page
at a time without loading all the records. Is there a way to achieve the
same with tapestry. I mean , is there a way to load a page at a time from
the database using tapestry pagination.
Kind regards.
Josh.
Re: pagination
Posted by Ulrich Stärk <ul...@spielviel.de>.
Also have a look at Tapestry's Hibernate integration [1] which supplies a HibernateGridDataSource
[2] that implements pagination and only fetches the necessary objects from the database.
Uli
[1] http://tapestry.apache.org/hibernate.html
[2]
http://tapestry.apache.org/tapestry5.2-dev/apidocs/org/apache/tapestry5/hibernate/HibernateGridDataSource.html
On 24.02.2011 21:00, Howard Lewis Ship wrote:
> If you look at the source parameter of the Grid, it is a
> GridDataSource object. You can bind a List to the source parameter,
> and Tapestry takes care of converting the list to a GridDataSource,
> but for large result sets from a database, you really want to use the
> GridDataSource interface, because it supports sorting and pagination
> in the database.
>
> On Thu, Feb 24, 2011 at 11:53 AM, Josh Kamau <jo...@gmail.com> wrote:
>> Hi Users;
>>
>> How does tapestry do the pagination on a grid? Does it retrieve all the data
>> from the database and then does the pagination on the clientside or does it
>> retrieve a page at a time from the database?
>>
>> I have used wicket before and all i did was implement something like
>> getIterator(first, count, sortProperty, isAscending), That way, the way the
>> data is retrieved is transparent and i can write a dao that gets each page
>> at a time without loading all the records. Is there a way to achieve the
>> same with tapestry. I mean , is there a way to load a page at a time from
>> the database using tapestry pagination.
>>
>> Kind regards.
>> Josh.
>>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: pagination
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 24 Feb 2011 17:16:27 -0300, Josh Kamau <jo...@gmail.com>
wrote:
> Thanks guys.
:)
> I will implement the GridDataSource. I didnt know it existed.
It's in the Grid component reference as the type of the source parameter.
>
> Thiago, for some personal reasons, i prefer using mybatis(formerly
> ibatis)
> as opposed to hibernate (i had a very bad experience with hibernate in a
> live environment, most of it caused by my limited understanding of
> hibernate advanced features.)
Even using a different ORM framework, it still can be used as an example.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: pagination
Posted by Josh Kamau <jo...@gmail.com>.
Thanks guys.
I will implement the GridDataSource. I didnt know it existed.
Thiago, for some personal reasons, i prefer using mybatis(formerly ibatis)
as opposed to hibernate (i had a very bad experience with hibernate in a
live environment, most of it caused by my limited understanding of hibernate
advanced features.)
Josh.
ps: am eagerly waiting for the T5 in action book.
On Thu, Feb 24, 2011 at 11:12 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:
> On Thu, 24 Feb 2011 17:00:33 -0300, Howard Lewis Ship <hl...@gmail.com>
> wrote:
>
> If you look at the source parameter of the Grid, it is a
>> GridDataSource object. You can bind a List to the source parameter,
>> and Tapestry takes care of converting the list to a GridDataSource,
>> but for large result sets from a database, you really want to use the
>> GridDataSource interface, because it supports sorting and pagination
>> in the database.
>>
>
> In addition, take a look at the HibernateGridDataSource class from
> tapestry-hibernate.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: pagination
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 24 Feb 2011 17:00:33 -0300, Howard Lewis Ship <hl...@gmail.com>
wrote:
> If you look at the source parameter of the Grid, it is a
> GridDataSource object. You can bind a List to the source parameter,
> and Tapestry takes care of converting the list to a GridDataSource,
> but for large result sets from a database, you really want to use the
> GridDataSource interface, because it supports sorting and pagination
> in the database.
In addition, take a look at the HibernateGridDataSource class from
tapestry-hibernate.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: pagination
Posted by Howard Lewis Ship <hl...@gmail.com>.
If you look at the source parameter of the Grid, it is a
GridDataSource object. You can bind a List to the source parameter,
and Tapestry takes care of converting the list to a GridDataSource,
but for large result sets from a database, you really want to use the
GridDataSource interface, because it supports sorting and pagination
in the database.
On Thu, Feb 24, 2011 at 11:53 AM, Josh Kamau <jo...@gmail.com> wrote:
> Hi Users;
>
> How does tapestry do the pagination on a grid? Does it retrieve all the data
> from the database and then does the pagination on the clientside or does it
> retrieve a page at a time from the database?
>
> I have used wicket before and all i did was implement something like
> getIterator(first, count, sortProperty, isAscending), That way, the way the
> data is retrieved is transparent and i can write a dao that gets each page
> at a time without loading all the records. Is there a way to achieve the
> same with tapestry. I mean , is there a way to load a page at a time from
> the database using tapestry pagination.
>
> Kind regards.
> Josh.
>
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: pagination
Posted by Josh Kamau <jo...@gmail.com>.
Thanks HLS , I appreciate the quick response. I have already implemented a
simple case and its working. I am reading the user guide to make sure that i
dont miss anything out.
Josh.
On Thu, Feb 24, 2011 at 11:46 PM, Howard Lewis Ship <hl...@gmail.com>wrote:
> If you look at the source parameter of the Grid, it is a
> GridDataSource object. You can bind a List to the source parameter,
> and Tapestry takes care of converting the list to a GridDataSource,
> but for large result sets from a database, you really want to use the
> GridDataSource interface, because it supports sorting and pagination
> in the database.
>
> On Thu, Feb 24, 2011 at 11:53 AM, Josh Kamau <jo...@gmail.com>
> wrote:
> > Hi Users;
> >
> > How does tapestry do the pagination on a grid? Does it retrieve all the
> data
> > from the database and then does the pagination on the clientside or does
> it
> > retrieve a page at a time from the database?
> >
> > I have used wicket before and all i did was implement something like
> > getIterator(first, count, sortProperty, isAscending), That way, the way
> the
> > data is retrieved is transparent and i can write a dao that gets each
> page
> > at a time without loading all the records. Is there a way to achieve the
> > same with tapestry. I mean , is there a way to load a page at a time from
> > the database using tapestry pagination.
> >
> > Kind regards.
> > Josh.
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: pagination
Posted by Howard Lewis Ship <hl...@gmail.com>.
If you look at the source parameter of the Grid, it is a
GridDataSource object. You can bind a List to the source parameter,
and Tapestry takes care of converting the list to a GridDataSource,
but for large result sets from a database, you really want to use the
GridDataSource interface, because it supports sorting and pagination
in the database.
On Thu, Feb 24, 2011 at 11:53 AM, Josh Kamau <jo...@gmail.com> wrote:
> Hi Users;
>
> How does tapestry do the pagination on a grid? Does it retrieve all the data
> from the database and then does the pagination on the clientside or does it
> retrieve a page at a time from the database?
>
> I have used wicket before and all i did was implement something like
> getIterator(first, count, sortProperty, isAscending), That way, the way the
> data is retrieved is transparent and i can write a dao that gets each page
> at a time without loading all the records. Is there a way to achieve the
> same with tapestry. I mean , is there a way to load a page at a time from
> the database using tapestry pagination.
>
> Kind regards.
> Josh.
>
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org