title: GWT SimplePager - Getting Incorrect pager index onclick of pager's LastButton
body: <p>I am using my GWT 2.3  Celltable &amp; SimplePager</p>
  
  <p>Written CustomPager by extending SimplePager class.</p>
  
  <p>Used ListBox to show different page size for celltable like 10,20,50,100</p>
  
  <p>I am showing 11 record in celltable when page size is 10. (1 empty record(row) + 10 records(rows)</p>
  
  <p>when pageSize = 20 then 21 rows(records), 
  when pageSize = 50 then 51 rows(records), 
  when pageSize = 100 then 101 rows(records).</p>
  
  <p>Whenever selected page size 50 or 100, pager &amp; display returning correct values so pagination working correctly, but not working in case of 10 &amp; 20. Strange :| </p>
  
  <p>After debugging found following thing:</p>
  
  <p>When page size is 10 or 20, onclick of lastPage button of pager getting Incorrect pageIndex of pager &amp; incorrect values of startIndex. </p>
  
  <p>wrong startindex = display.getVisibleRange().getStart()</p>
  
  <pre><code>//Following method called when button click event fires
  
   protected void onRangeChanged(HasData&lt;RecordVO&gt; display) {
  
              info("Called onRangeChanged method of AsyncDataProvider");
  
              eventType = "PAGINATION";
  
              setPrevPageIndexForChangedRecord();
              cellTable.setRowCount(searchRecordCount, false);
  
              startRowIndexOfPage = display.getVisibleRange().getStart(); // startRowIndex;
               // ------ My code is here
  
  }
  </code></pre>
  
  <p>Incorrect value is as follows when clicked on pagers Last button assume page size=10 i.e 1 dummy record + 10 Actual record.</p>
  
  <pre><code>    startRowIndexOfPage = display.getVisibleRange().getStart(); // startRowIndex;
      info("Start row index of page = "+startRowIndexOfPage);
      info("GWT Current page index = "+pager.getPage());
      info("GWT Total page count = "+pager.getPageCount());
      info("Gwt Total page size  = "+pager.getPageSize());
      info("Gwt page start index = "+pager.getPageStart());
  </code></pre>
  
  <p>Incorrect Output onclick of pagers last button when page size=10 :</p>
  
  <pre><code>(-:-) 2013-03-05 09:53:22,136 [INFO ] Start row index of page = 990
  (-:-) 2013-03-05 09:53:22,150 [INFO ] GWT Current page index = 90
  (-:-) 2013-03-05 09:53:22,178 [INFO ] GWT Total page count = 91
  (-:-) 2013-03-05 09:53:22,191 [INFO ] Gwt Total page size = 11
  (-:-) 2013-03-05 09:53:22,204 [INFO ] Gwt page start index = 990
  </code></pre>
  
  <p><strong>Main problem is that pager.getPage() returning 90 instead of last page index :(</strong></p>
  
  <p>Is there any way to solve this problem? Please provide me some pointers/solution for this question.</p>
  
  <p>Thanks in advance.</p>