nikhilbchilwant / google-web-toolkit-incubator

Automatically exported from code.google.com/p/google-web-toolkit-incubator
1 stars 1 forks source link

PagingScrollTable can have negetive page number #324

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What version of gwt and gwt-incubator are you using?
Trunk, trunk

What OS and browser are you using?
Mac, Firefox

Do you see this error in hosted mode, web mode, or both?
Both

(If possible, please include a test case that shows the problem)
Create a PagingScrollTable with PagingOptions.
Click on previous button, the page number becomes 0, click again become -1
and so on.

What is the expected output? What do you see instead?
page number > 0 , and visible page number Should never be -1

Workaround if you have one:
Create PagingScrollTable in this way 
pagingScrollTable = new PagingScrollTable<RowType>
      (cachedTableModel,tableDefinition) 
{
   public void gotoPage(int page, boolean forced) {
      super.gotoPage(Math.max(page,0);
   }
};

Please provide any additional information below,  and thank you for taking
the time and effort to report this issue, as good issue reports are
critical for our quest to make GWT's new widgets and libraries shine.

Here is code from PagingScrollTable::gotoPage
(package com.google.gwt.gen2.table.client)

Note: numPages >= 0, but not page >= 0
  public void gotoPage(int page, boolean forced) {
    int oldPage = currentPage;
    int numPages = getPageCount();
    if (numPages >= 0) {
      currentPage = Math.max(0, Math.min(page, numPages - 1));
    } else {
      currentPage = page;
    }

Original issue reported on code.google.com by harmeet....@gmail.com on 9 Nov 2009 at 2:51