GWT SimplePager

It’s unfortunate that my initial experience with GWT’s SimplePager wasn’t very positive. The paging behaviour toward end of the list showed the following:

  1. For the last page, pager would attempt to request record count at last index + page size. This would cause pager to go index array out of bound. i.e. Let’s say you have 95 records with a page size of 10. The last page’s record index should be 90. If you add page size to it, you get 100. Requesting records between 90 and 100 caused the index array out of bound exception.
  2. If you use next page button navigate to the last page, it would display the last page in a way that the pager would fill the last page with a number of records the same as page size, no matter how many total records are. This created a very weird user experience. i.e For the same parameters above, you would see records #80-90 on the second to last page and then #85-95 on the last page.

After looking on-line for answers, I came across this thread and it helped me to resolve the issues that I observed above. 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s