Hi,

I am using AsyncDataProvider and in my testcase I have 3 pages:
  • First page: 1 to 10, renders correctly as 1-10 of 23
  • Second page: 11 to 20, renders correctly as 11-20 of 23
  • Last page: 21 to 23, renders wrong as 14-23 of 23 instead of 21-23 of 23
    • The data is messed up
    • Going back to the second page messes up the second page too
I checked the start and pageSizes being send to the server for the last page: they are correct.
I do 2 things in my server callback:
  • updateRowCount((int) result.getTotal(), true);
    • Removing that line fixes the problem, but then it reports 21-23 of above 23
      • The tutorials recommend of setting the row count
  • updateRowData(start, result.getRowList());
Here's the full code:

AsyncDataProvider<TableDataRow> dataProvider = new AsyncDataProvider<TableDataRow>() {
    protected void onRangeChanged(HasData<TableDataRow> display) {
        final int start = pager.getPage() * pageSize;
        server.loadData(start, pageSize,
                 new GenericCallback<TableDataResult>() {
                     public void onSuccess(TableDataResult result) {
                         updateRowCount((int) result.getTotal(), true); // Without this line it works perfect, with it it doesn't on the last page
                         updateRowData(start, result.getRowList());
                     }
                 });
    }
};
-- 
With kind regards,
Geoffrey De Smet


--
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-tool...@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