DisplayTag

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

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0
  • Fix Version/s: 1.1
  • Component/s: Configuration
  • Labels:
    None

Description

{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 };

Activity

Hide
fabrizio giustina added a comment -
fixed in CVS for 1.1, thanks
Show
fabrizio giustina added a comment - fixed in CVS for 1.1, thanks
Hide
Stefan Baramov added a comment -
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.
Show
Stefan Baramov added a comment - 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.
Hide
fabrizio giustina added a comment -
thanks, I'm reopening the issue: I will add a test case with a single page and fix it as suggested
Show
fabrizio giustina added a comment - thanks, I'm reopening the issue: I will add a test case with a single page and fix it as suggested
Hide
fabrizio giustina added a comment -
test added and fix committed for the last-page problem
Show
fabrizio giustina added a comment - test added and fix committed for the last-page problem

People

  • Reporter:
    Anonymous
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: