I encountered the same problem :-(

What's more ominous is that the change in visibleRange also causes a
second onRangeChange event (which is undesirable if nothing else): (1)
For the initial page forward to the last page (with potential unequal
number of rows to pageSize) and (2) For the re-rendering of the last
page with visibleRange set to show pageSize rows but indexed from
display.getRowCount() - pageSize (as noted by OP).

I found a fix however, by overriding setPageStart in SimplePager, as
follows:-

            public void setPageStart(int index) {
                if ( getDisplay() != null ) {
                    Range range = getDisplay().getVisibleRange();
                    int pageSize = range.getLength();
                    if ( isRangeLimited()
                         && getDisplay().isRowCountExact() ) {
                        pageSize = Math.min( pageSize,
 
getDisplay().getRowCount()
                                                     - index );
                    }
                    index = Math.max( 0,
                                      index );
                    if ( index != range.getStart() ) {
                        getDisplay().setVisibleRange( index,
                                                      pageSize );
                    }
                }
            }

This shows the last page with a number of rows less than pageSize if
getRowCount() is less than pageSize * numberOfPages.

I hope it is of use.

Cheers,

Mike

On Dec 5 2010, 6:25 pm, Arnaud <arnaud.oi...@gmail.com> wrote:
> I have exactly the same problem than sebrojas, if someone has a
> solution. Would appreciate any help.
>
> Thanks
> Arnaud
>
> On Nov 2, 7:29 pm, sebrojas <sebroja...@gmail.com> wrote:
>
> > Yes, is a bug!
>
> > Also, I´m having other problems with celltable paging.
> > When I set the page size to 12 or less, and I click the button next
> > page or last page, and rows away is a picture of charging that is not
> > removed.
> > When I set the page size in 13 or more, and I click the button next
> > page or last page, and then on the previous page shows several rows
> > without values (the first).
> > Please answer, need help
> > I don´t understand why the pager have a setPageSize method and the
> > dell table too??? :s, but it seems to the table method is the one that
> > have effect
>
> > ...
> > ProvidesKey<Depuracion> pk = new ProvidesKey<Depuracion>() {
> >                         public Object getKey(Depuracion item) {
> >                                 return item.getId();
> >                         }
> >                 };
>
> >                 final CellTable<Depuracion> table = new 
> > CellTable<Depuracion>(pk);
> >                 table.addStyleName("tabla");
> >                 table.setPageSize(8);
>
> >                 // Create a Pager to control the table.
> >                 SimplePager.Resources pagerResources = GWT
> >                                 .create(SimplePager.Resources.class);
> >                 pager = new SimplePager(TextLocation.CENTER, 
> > pagerResources, false,
> > 0,
> >                                 true);
> >                 pager.setDisplay(table);
> > ...
>
>

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

Reply via email to