]> source.dussan.org Git - vaadin-framework.git/commitdiff
IScrollTable: allow clearing content totally
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 2 Nov 2007 13:24:54 +0000 (13:24 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 2 Nov 2007 13:24:54 +0000 (13:24 +0000)
svn changeset:2686/svn branch:trunk

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

index d6962553eaac9878792c04f5ae6559c9695f0a1c..d3976999a9ee5db87f7fe8894267901182220d63 100644 (file)
@@ -285,8 +285,15 @@ public class IScrollTable extends Composite implements Table, ScrollListener,
         *            amount of rows in data set
         */
        private void updateBody(UIDL uidl, int firstRow, int reqRows) {
-               if (uidl == null || reqRows < 1)
+               if (uidl == null || reqRows < 1) {
+                       // container is empty, remove possibly existing rows
+                       if(firstRow < 0) {
+                               while(tBody.getLastRendered() > tBody.firstRendered)
+                                       tBody.unlinkRow(false);
+                               tBody.unlinkRow(false);
+                       }
                        return;
+               }
 
                tBody.renderRows(uidl, firstRow, reqRows);
 
@@ -1517,7 +1524,7 @@ public class IScrollTable extends Composite implements Table, ScrollListener,
                }
 
                /**
-                * This mehtod is used to instantiate new rows for this table. It
+                * This method is used to instantiate new rows for this table. It
                 * automatically sets correct widths to rows cells and assigns correct
                 * client reference for child widgets.
                 *