I fixed the bug with the invalid enabled "next page" button while
setting setRangeLimited(false) by overwriting the hasNextPage()
method:

/* (non-Javadoc)
                         * @see
com.google.gwt.user.cellview.client.SimplePager#hasNextPage()
                         */
                        @Override
                        public boolean hasNextPage() {

                                if(this.getPage()<(this.getPageCount()-1)) {
                                        return true;
                                }
                                return false;
                        }

On Apr 6, 8:32 pm, Patrick Tucker <[email protected]>
wrote:
>  It seems my original reply didn't get recorded properly, so I will try
> again with less detail...
>
> I noticed that if you call setRangeLimited(false), you get the behavior that
> you expect, but the forward buttons do not get grayed out.
>
> If you look at setPageStart(int) is uses isRangeLimited and display's
> isRowCountExact() values to determine whether or not pageSize records should
> be shown.  If both are true you will get your page of pageSize.  It seems to
> me that if isRangeLimited, meaning "whether or not the page range should be
> limited to the actual data", is true you would want to only see the 5
> remaining records instead of a full page of pageSize records.
>
> So what I did was copy AbstractPager into my project and change
> isRangeLimited to !isRangeLimited in setPageStart(int).  See code below:
>   protected void setPageStart(int index) {
>     if (display != null) {
>       Range range = display.getVisibleRange();
>       int pageSize = range.getLength();
>       if (!isRangeLimited && display.isRowCountExact()) {
>         index = Math.min(index, display.getRowCount() - pageSize);
>       }
>       index = Math.max(0, index);
>       if (index != range.getStart()) {
>         display.setVisibleRange(index, pageSize);
>       }
>     }
>   }
>
> You could also extend SimplePager and accomplish the same thing...
>
> Can someone from the GWT team comment on this?
>
> Thanks,
> Pat

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to