Issue Details (XML | Word | Printable)

Key: DISPL-213
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Reporter: Peter Luttrell
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DisplayTag

Page Listing Incorrect

Created: 13/May/05 03:01 PM   Updated: 07/Sep/07 06:33 AM   Resolved: 11/Sep/05 11:58 AM
Return to search
Component/s: Paging/Sorting
Affects Version/s: 1.0
Fix Version/s: 1.1

Time Tracking:
Not Specified


 Description  « Hide
Depending on the number of results for which DisplayTag is paginating, the last page is often NOT displayed.

For example if you're paginating 110 results in pages of 10 you should get 11 pages, but only 10 show up. You can get to the 11th page by hitting last - it's just not showing up in the list of pages. Another example is 220 paginated by 20.

I have modified example-paging.jsp to show the problem.

<%@ include file="inc/header.jsp" %>

<% Object foo = request.getAttribute( "test" );
   if( foo == null ) {
      request.setAttribute( "test", new TestList(110, false) );
   }
%>

<h2>Here's a test of 110 in pages of 10</h2>

<display:table name="requestScope.test" pagesize="10">
<display:column property="id" title="ID" />
<display:column property="name" />
<display:column property="email" />
<display:column property="status" />
</display:table>


<%@ include file="inc/footer.jsp" %>



gzentw added a comment - 02/Jun/05 04:26 AM
Hello.

I think i found the problem for this issue.

The bug lies in the Class org.displaytag.pagination.SmartListHelper in the method getPageNavigationBar(Href baseHref, String pageParameter):
This method generates the navigationbar.
While computing the startPage there is a little mistake:
The line:

startPage =
 Math.max(Math.min(this.currentPage - groupSize / 2, this.pageCount - groupSize),1);

has to be changed to:

startPage =
 Math.max(Math.min(this.currentPage - groupSize / 2, this.pageCount - groupSize + 1),1);

I tried it and it works fine.

Regards
Markus

fabrizio giustina added a comment - 11/Sep/05 11:58 AM
fixed in CVS for 1.1, thanks

Peter Luttrell added a comment - 13/Sep/05 01:15 AM
This is tagged for v1.1. Do you have any idea when that might come out? I need to let my boss know when he might get this functionality fixed.

karthik added a comment - 07/Sep/07 06:33 AM
When going through a list of 92items with 10rows per page the header shows only the page numbers up to 9(instead of 10). Using the "next" functionality you can go to the last page, but then no "current page" is displayed.if i am using Tomcat 5.5.23 it works correctly but web logic 9.0 the same problem still exists.