熟悉ibatis的請幫幫忙!

freetan發表於2004-08-08
I use the executeQueryForPaginatedList() which returns a PaginatedList that retrieves records from the database at a time for display on a JSP. some code as follows:
PaginatedList pagelist=myservice.getFactitem();
<%
String pagedirection=servlet.requestStr(request,"pageDirection");
if (pagedirection.equals("previous")) {
pagelist.previousPage();}
else if (pagedirection.equals("next")) {
pagelist.nextPage();
}
%>
......
......//read and displayed data
......
<table align="center">
<tr >
<td colspan="5" align="right" valign="middle" class=link04>total<font color=red><%= myservice.getFactitemnum() %></font>records
<% if (pagelist.isPreviousPageAvailable()) { %><a href="index.jsp?pageDirection=previous"><img src="/images/prev.gif" border="0"></a>
<% } if (pagelist.isNextPageAvailable()) { %><a href="index.jsp?pageDirection=next"><img src="/images/next.gif" border="0"></a>
<% } %> </td>
</tr></table>
------CASE----
when I have ONLY 2 page of records(20 rows), clicked on the "next page" button, row 11~20 were displayed. then clicked on "previous page" button,row 1~10 were displayed. when I have MORE THAN 2 page of records clicked on the "next page" button, row 21~30 were not displayed. the "next page" button do not work! what's wrong with my code? please help me!

Thanks...

相關文章