Are you using a SimplePager? The pager isn't setting the page range intuitively, and a lot of users have been complaining. We'll take another look for GWT 2.1.1.
Thanks, John LaBanca [email protected] On Tue, Nov 2, 2010 at 6:17 AM, Geoffrey De Smet <[email protected]>wrote: > 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-web-toolkit%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > -- 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.
