ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zhongmin Chen <zhongmin.c...@gmail.com>
Subject Re: Retrieving next page using pagenatedList
Date Wed, 03 Aug 2005 17:32:02 GMT
Hi Sreenivas,

PaginatedList extends java.util.List, so you can iterate over it using
the same way for java.util.List.

PaginatedList will maintain three list: previous page, current page,
and next page. When you call the method in java.util.List, it will
iterate over current page. When you call nextPage(), old "current
page" will become "previous page", old "next page" will become
"current page", and it will retrieve new "next page". Similar to other
method in PaginatedList.

Regards,
Zhongmin

On 8/3/05, Konda, Sreenivasulu (Consultant)
<Sreenivasulu.Konda@consultmail.net> wrote:
>  Hi Zhongmin,
> 
> Thanks for the details. As nextPage() returns true or false, how can I
> iterate over next set of records?
> 
> Or, if my understanding is correct, the nextPage() call retrieves new
> rows into PagenatedList object?
> 
> Please correct me if I am wrong.
> 
> Thanks and regards,
> Sreenivas
> 
> -----Original Message-----
> From: Zhongmin Chen [mailto:zhongmin.chen@gmail.com]
> Sent: Tuesday, August 02, 2005 6:14 PM
> To: user-java@ibatis.apache.org
> Subject: Re: Retrieving next page using pagenatedList
> 
> Hi,
> 
> 1) you can use some code like below to get next page
> if(results.isNextPageAvailable()){
>         results.nextPage();
> }
> 
> 2) If you pass pageSize to the call:
> queryForPaginatedList(java.lang.String id, java.lang.Object
> parameterObject, int pageSize), first time it will fetch at most
> 2*pageSize records.
> 
> Regards,
> Zhongmin
> 
> 
> On 8/2/05, Konda, Sreenivasulu (Consultant)
> <Sreenivasulu.Konda@consultmail.net> wrote:
> >
> > Hi All,
> >
> > I looked at PagenatedList for implementing "Next" and "Previous"
> > features on JSP page.
> >
> > I am getting the list for  first time to display a subset of records
> > in the list, when user clicks Next button, I called
> > isNextPageAvailable() and then nextPage(), but nothing happens.
> >
> > My questions are:
> >
> > 1) How to get next/previous set of records using pagenatedlist(pseudo
> > code would be of great help since I am new to iBATIS)?
> > 2) As I read in the iBATIS developer guide, the pagenatedlist returns
> > all rows(if 1000 records are matched for the given query, the list
> > contains 1000
> > rows) matched for given query. If my understanding is correct, is
> > there a way to restrict pagenatedlist not to retrieve 1000 records in
> first fetch?
> >
> > Thanks and regards,
> > Sreenivas
>

Mime
View raw message