Author: felixk Date: Wed Sep 21 05:44:08 2011 New Revision: 1173502 URL: http://svn.apache.org/viewvc?rev=1173502&view=rev Log: Fix HUPA-75
Modified: james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/PagingOptions.java Modified: james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/PagingOptions.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/PagingOptions.java?rev=1173502&r1=1173501&r2=1173502&view=diff ============================================================================== --- james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/PagingOptions.java (original) +++ james/hupa/trunk/widgets/src/main/java/org/apache/hupa/widgets/ui/PagingOptions.java Wed Sep 21 05:44:08 2011 @@ -79,13 +79,9 @@ public class PagingOptions extends Compo table.addPageCountChangeHandler(new PageCountChangeHandler() { public void onPageCountChange(PageCountChangeEvent event) { - int startCount = currentPage * table.getPageSize(); + int startCount = currentPage * table.getPageSize() + 1; - if (currentPage == 0) { - startCount = 0; - } - - int endCount = startCount + table.getPageSize(); + int endCount = currentPage * table.getPageSize() + table.getPageSize(); int rows = table.getTableModel().getRowCount(); updateControl(startCount, endCount, rows); @@ -100,13 +96,9 @@ public class PagingOptions extends Compo loading(true); currentPage = event.getNewPage(); - int startCount = currentPage * table.getPageSize(); - - if (currentPage == 0) { - startCount = 0; - } + int startCount = currentPage * table.getPageSize() + 1; - int endCount = startCount + table.getPageSize(); + int endCount = currentPage * table.getPageSize() + table.getPageSize(); int rows = table.getTableModel().getRowCount(); @@ -165,13 +157,9 @@ public class PagingOptions extends Compo table.getTableModel().addRowCountChangeHandler(new RowCountChangeHandler() { public void onRowCountChange(RowCountChangeEvent event) { - int startCount = currentPage * table.getPageSize(); - - if (currentPage == 0) { - startCount = 0; - } + int startCount = currentPage * table.getPageSize() + 1; - int endCount = startCount + table.getPageSize(); + int endCount = currentPage * table.getPageSize() + table.getPageSize(); int rows =event.getNewRowCount(); updateControl(startCount, endCount, rows); @@ -207,7 +195,7 @@ public class PagingOptions extends Compo startCount = 0; } - if (startCount <= 0) { + if (startCount <= 1) { firstLink.setEnabled(false); prevLink.setEnabled(false); } else { --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org