Saturday, July 30, 2011

Re: Cell Table, Remote Paging Issues

This is a well known issue with Abstract Pager/SimplePager. I don't
like this behavior (and the look of the default SimplePager), so I
ended up writing my own pager along the following lines:

http://www.mail-archive.com/google-web-toolkit@googlegroups.com/msg62763.html

Basically, I had to overwrite lastPage(), firstPage(), nextPage() and
previousPage() with the behavior that I wanted.


On Jul 30, 3:29 am, BST <babusri...@gmail.com> wrote:
> I am trying out Remote Paging with a Cell Table & Implementation of Abstract
> Pager . For now I am limiting the CellTable to 30 rows for data. My Pager
> takes care of fetching the next batch of 30 rows from RemoteService, when
> the next or previous button is clicked.
>
> I get 30 rows of data from the service, which I put into a list and set it
> to the ListDataProvider. The List can have only 30 rows of data at a time. I
> am doing all the calculations for calculating which page I am in, and when
> do I have to fetch the data.
>
> Everything is working perfectly except for one scenario, I am on the last
> page which has only 20  rows, as the data is exhausted on the Server.
>
> When I go previous, I set the table Visible range to(20,10), 10 being the
> pageSize, then I get the previous batch of data so that when the
> listDataProvider gets the new List the table shows the last page. But I find
> that it always goes to the first page which is visible range (0,10)..
>
> The reason is that when I set the Visible Range to 20,10 since present table
> count is only 20, the visible range is not set properly..
>
> If i set the Visible Range after I get the data from the server, the problem
> is pretty much the same, since the server call for data is asynchronous and
> data comes much after I set the visible range.
>
> Only option is to use a timer but I don't think that would be wise. Any
> ideas is much appreciated? I guess it is just about a better logic to handle
> to handle the paging. Mine seems to be lacking..

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment