DisplayTag

External paging paging.banner.some_items_found displays 1-10 always

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 1.1
  • Fix Version/s: 1.1.1
  • Component/s: Paging/Sorting
  • Labels:
    None
  • Application server:
    t

Activity

Hide
lizongbo added a comment -
we can fix this bug by follow code:

java file : displaytag-all/displaytag/src/main/java/org/displaytag/pagination/SmartListHelper.java

method need update : getFirstIndexForCurrentPage && getLastIndexForCurrentPage.
new code :
-------------------
    public int getFirstIndexForCurrentPage() {
        return (this.currentPage - 1) * this.pageSize;
    }

    protected int getLastIndexForCurrentPage() {
        if (this.partialList) {
            return (getFirstIndexForCurrentPage()) +
                    Math.min(this.pageSize - 1, this.fullList.size() - 1);
        } else {
            return getLastIndexForPage(this.currentPage);
        }
    }

-------------------

Show
lizongbo added a comment - we can fix this bug by follow code: java file : displaytag-all/displaytag/src/main/java/org/displaytag/pagination/SmartListHelper.java method need update : getFirstIndexForCurrentPage && getLastIndexForCurrentPage. new code : -------------------     public int getFirstIndexForCurrentPage() {         return (this.currentPage - 1) * this.pageSize;     }     protected int getLastIndexForCurrentPage() {         if (this.partialList) {             return (getFirstIndexForCurrentPage()) +                     Math.min(this.pageSize - 1, this.fullList.size() - 1);         } else {             return getLastIndexForPage(this.currentPage);         }     } -------------------
Hide
Kevin Conaway added a comment -
Please see the patch attached to DISPL-304
Show
Kevin Conaway added a comment - Please see the patch attached to DISPL-304
Hide
fabrizio giustina added a comment -
Show
fabrizio giustina added a comment - see DISPL-304

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: