]> source.dussan.org Git - vaadin-framework.git/commitdiff
Don't send a partial row update the first time the component is painted (#7605)
authorLeif Åstrand <leif@vaadin.com>
Thu, 22 Sep 2011 11:14:59 +0000 (11:14 +0000)
committerLeif Åstrand <leif@vaadin.com>
Thu, 22 Sep 2011 11:14:59 +0000 (11:14 +0000)
svn changeset:21233/svn branch:6.7

src/com/vaadin/ui/Table.java
tests/src/com/vaadin/tests/components/treetable/TreeTableSetCollapsed.html
tests/src/com/vaadin/tests/components/treetable/TreeTableSetCollapsed.java

index 45cd1bf9a36accaa873d216876d27ad4f5716660..7b3df3447104b2bbf3cb07106dc68325de5b45b9 100644 (file)
@@ -406,6 +406,8 @@ public class Table extends AbstractSelect implements Action.Container,
 
     private final Map<Field, Property> associatedProperties = new HashMap<Field, Property>();
 
+    private boolean painted = false;
+
     /* Table constructors */
 
     /**
@@ -2481,7 +2483,7 @@ public class Table extends AbstractSelect implements Action.Container,
         paintVisibleColumnOrder(target);
 
         // Rows
-        if (isPartialRowUpdate() && !target.isFullRepaint()) {
+        if (isPartialRowUpdate() && painted && !target.isFullRepaint()) {
             paintPartialRowUpdate(target, actionSet);
         } else if (target.isFullRepaint() || isRowCacheInvalidated()) {
             paintRows(target, cells, actionSet);
@@ -2505,6 +2507,8 @@ public class Table extends AbstractSelect implements Action.Container,
         if (dropHandler != null) {
             dropHandler.getAcceptCriterion().paint(target);
         }
+
+        painted = true;
     }
 
     private void setRowCacheInvalidated(boolean invalidated) {
index e06068c8165238e3bf5ba4da64cc87dccb4bd4a8..5c878dba42f8f81785eaaad9aae1e5f83a69a398 100644 (file)
        <td>vaadin=runcomvaadintestscomponentstreetableTreeTableSetCollapsed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
        <td></td>
 </tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentstreetableTreeTableSetCollapsed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertElementPresent</td>
+       <td>vaadin=runcomvaadintestscomponentstreetableTreeTableSetCollapsed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTreeTable[0]/domChild[1]</td>
+       <td></td>
+</tr>
 </tbody></table>
 </body>
 </html>
index 3dd072372275a4bc0325730b72457d5584df03e0..2a14c946f39f4afc821820d936be97c8170e4dea 100644 (file)
@@ -1,12 +1,24 @@
 package com.vaadin.tests.components.treetable;
 
 import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
 import com.vaadin.ui.TreeTable;
 
 public class TreeTableSetCollapsed extends TestBase {
 
     @Override
     protected void setup() {
+        createTreeTableAndPopulate();
+        addComponent(new Button("Create another TreeTable",
+                new Button.ClickListener() {
+                    public void buttonClick(ClickEvent event) {
+                        createTreeTableAndPopulate();
+                    }
+                }));
+    }
+
+    private void createTreeTableAndPopulate() {
         TreeTable tt = new TreeTable();
         tt.addContainerProperty("Foo", String.class, "");
         tt.addContainerProperty("Bar", String.class, "");