diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2007-06-21 07:39:10 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2007-06-21 07:39:10 +0000 |
commit | 5e0605926cdd4326b6638461b93756436f0f31bd (patch) | |
tree | e78a240703988ee151e34092ccdde8ba646fd322 | |
parent | e7552288f2df8a46c7d1a9a34acd8d608d4bbe22 (diff) | |
download | vaadin-framework-5e0605926cdd4326b6638461b93756436f0f31bd.tar.gz vaadin-framework-5e0605926cdd4326b6638461b93756436f0f31bd.zip |
some fixes to paging table
svn changeset:1778/svn branch:trunk
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/ui/ITablePaging.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITablePaging.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITablePaging.java index 3a0ebce759..01d189021c 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ITablePaging.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ITablePaging.java @@ -56,6 +56,7 @@ public class ITablePaging extends Composite implements Paintable, ClickListener private int firstRow; private boolean sortAscending = true; + private HorizontalPanel pager; public ITablePaging() { @@ -63,7 +64,7 @@ public class ITablePaging extends Composite implements Paintable, ClickListener VerticalPanel panel = new VerticalPanel(); - HorizontalPanel pager = new HorizontalPanel(); + pager = new HorizontalPanel(); pager.add(firstPage); firstPage.addClickListener(this); pager.add(prevPage); @@ -110,7 +111,7 @@ public class ITablePaging extends Composite implements Paintable, ClickListener else if(c.getTag().equals("visiblecolumns")) updateVisibleColumns(c); } - tBody.resize(rows+1, visibleColumns.size() + (rowHeaders ? 1 : 0 )); + tBody.resize(rows+1, columnInfo.getChidlCount() + (rowHeaders ? 1 : 0 )); updateHeader(columnInfo); @@ -186,6 +187,10 @@ public class ITablePaging extends Composite implements Paintable, ClickListener } private void updatePager() { + if(pageLength == 0) { + pager.setVisible(false); + return; + } if(isFirstPage()) { firstPage.setEnabled(false); prevPage.setEnabled(false); @@ -204,7 +209,7 @@ public class ITablePaging extends Composite implements Paintable, ClickListener } private boolean hasNextPage() { - if(firstRow + pageLength + 1 > totalRows) + if(firstRow + rows + 1 > totalRows) return false; return true; } |