Issue Details (XML | Word | Printable)

Key: DISPL-232
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Reporter: Anonymous
Votes: 0
Watchers: 0
Operations

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

paging.banner.full: {6} is not the total number of pages

Created: 16/Aug/05 05:15 AM   Updated: 29/Oct/05 10:07 AM   Resolved: 29/Oct/05 10:07 AM
Return to search
Component/s: Configuration
Affects Version/s: 1.0
Fix Version/s: 1.1

Time Tracking:
Not Specified


 Description  « Hide
{6} in the configuration item paging.banner.full does not display the total number of pages (as it should according to the documentation), but the number of page links displayed in the banner.

Following is the correction for Pagination.java:

        Object[] pageObjects = {
            numberedPageString,
            ((Href) this.href.clone()).addParameter(this.pageParam, getFirst()),
            ((Href) this.href.clone()).addParameter(this.pageParam, getPrevious()),
            ((Href) this.href.clone()).addParameter(this.pageParam, getNext()),
            ((Href) this.href.clone()).addParameter(this.pageParam, getLast()),
            this.currentPage,
            /* (MVL) corrected: should be number of pages: new Integer(pages.size()) */
            this.isLast() ? this.currentPage : this.lastPage };


fabrizio giustina added a comment - 11/Sep/05 12:29 PM
fixed in CVS for 1.1, thanks

Stefan Baramov added a comment - 22/Sep/05 10:52 AM
I've looke the source code from Sep 11 and found the bug is not fixed correctly. The original suggestion is correct: this.isLast() ? this.currentPage : this.lastPage . The current version is : this.lastPage. It breaks when the last page is displayed (then this.lastPage is null).

Please reopen the issue.

fabrizio giustina added a comment - 23/Sep/05 03:42 AM
thanks, I'm reopening the issue: I will add a test case with a single page and fix it as suggested

fabrizio giustina added a comment - 29/Oct/05 10:07 AM
test added and fix committed for the last-page problem