]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #1943, recalculate columns widths when table rows change from 0
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 27 Aug 2008 12:41:19 +0000 (12:41 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 27 Aug 2008 12:41:19 +0000 (12:41 +0000)
svn changeset:5278/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java

index 8dd88b4c7bf3b7371e185608f615e037a5459f0e..25209a143199527fe1e0fd54be6cd7a418c8f50e 100644 (file)
@@ -156,12 +156,15 @@ public class IScrollTable extends Composite implements Table, ScrollListener,
         immediate = uidl.getBooleanAttribute("immediate");
         final int newTotalRows = uidl.getIntAttribute("totalrows");
         if (newTotalRows != totalRows) {
-            totalRows = newTotalRows;
             if (tBody != null) {
+                if (totalRows == 0) {
+                    tHead.clear();
+                }
                 initializedAndAttached = false;
                 initialContentReceived = false;
                 isNewBody = true;
             }
+            totalRows = newTotalRows;
         }
 
         pageLength = uidl.getIntAttribute("pagelength");
@@ -1273,6 +1276,13 @@ public class IScrollTable extends Composite implements Table, ScrollListener,
             availableCells.put("0", new RowHeadersHeaderCell());
         }
 
+        public void clear() {
+            super.clear();
+            availableCells.clear();
+            availableCells.put("0", new RowHeadersHeaderCell());
+
+        }
+
         public void updateCellsFromUIDL(UIDL uidl) {
             Iterator it = uidl.getChildIterator();
             HashSet updated = new HashSet();