You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by John Chien <jo...@ncmail.net> on 2006/04/12 21:19:03 UTC

what does the PaginatedList method means ?

Dear Sir:

After we called the iBatis queryForPaginatedList(), we get a list of 
type PaginatedList.
Let us call it queryResultList;
The PaginatedList has several methods like:

void gotoPage(int i);
boolean nextPage();
boolean previosPage();

What does these methods mean ?
What I want is to get a list to be returned to client side to be displayed.
Let us call it toBeDisplayList;


1) I want to go to page 5, so I write the following statement
   
queryResultList.getoPage(5);  What does this mean ?

Suppose the queryResultList have 600 element originally, and each page 
display 30 elements,
after calling queryResultList.getoPage(5) , does the queryResultList 
become a subList that begins with the 121th element ?

2) I am in page 1, and I want to go to next page

boolean ok = queryResultList.nextPage();
The ok is true.

Does the queryResultList become the sublist that begins from 31th element ?

Do I need to call a subList method to return a sublist that I want to 
display ?

Thanks,

John Chien


 




Re: what does the PaginatedList method means ?

Posted by Zarar Siddiqi <za...@utoronto.ca>.
All the questions you are asking can be easily answered by writing some code 
and playing around with paginated lists for about fifteen minutes.  Maybe 
you should consider using DisplayTag instead of paginated lists since that 
will make your life easier and you won't have to worry about writing Java 
code to handle paging.  Using either method carries approximately the same 
performance hit.  As mentioned earlier, if performance is your goal, write 
vendor specific SQL code to return smaller result sets.

Zarar


----- Original Message ----- 
From: "John Chien" <jo...@ncmail.net>
To: <us...@ibatis.apache.org>
Sent: Wednesday, April 12, 2006 3:19 PM
Subject: what does the PaginatedList method means ?


> Dear Sir:
>
> After we called the iBatis queryForPaginatedList(), we get a list of
> type PaginatedList.
> Let us call it queryResultList;
> The PaginatedList has several methods like:
>
> void gotoPage(int i);
> boolean nextPage();
> boolean previosPage();
>
> What does these methods mean ?
> What I want is to get a list to be returned to client side to be 
> displayed.
> Let us call it toBeDisplayList;
>
>
> 1) I want to go to page 5, so I write the following statement
>
> queryResultList.getoPage(5);  What does this mean ?
>
> Suppose the queryResultList have 600 element originally, and each page
> display 30 elements,
> after calling queryResultList.getoPage(5) , does the queryResultList
> become a subList that begins with the 121th element ?
>
> 2) I am in page 1, and I want to go to next page
>
> boolean ok = queryResultList.nextPage();
> The ok is true.
>
> Does the queryResultList become the sublist that begins from 31th element 
> ?
>
> Do I need to call a subList method to return a sublist that I want to
> display ?
>
> Thanks,
>
> John Chien
>
>
>
>
>
>
>