I use the SimplePager to page my CellTable. I have setup an
AsyncDataProvider for the data but know beforehand how many rows there
will be

All the pages display fine, but the last. It is as big as the other.
If I have a PageSize of 10 with 15 elements, the last page shows
elements 6 through 15. I'd prefer to have only 11 through 15 shown.

The solution I came up with, is to add the following lines of code to
onRangeChanged in my AsyncDataProvider:

      int start = range.getStart();
      int maxRows = form.getFormDataCount().get(formDataState);

      if(start + range.getLength() == maxRows) {
         start = maxRows - (range.getLength() - (start %
range.getLength()));
         display.setVisibleRange(start, maxRows - start);
      }

And I call my data provider with the new start and size parameters

this does the trick but I'm sure there is a better solution

-- 
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