]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #1178
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 29 Nov 2007 15:16:38 +0000 (15:16 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 29 Nov 2007 15:16:38 +0000 (15:16 +0000)
svn changeset:3048/svn branch:trunk

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

index d0ae64ed02f5016f5fdcafca44e18ea94ce42089..2d3328a4a52f5e7ece9102ae4d12877f04262281 100644 (file)
@@ -23,7 +23,6 @@ public class IGridLayout extends FlexTable implements Paintable, Container {
             return;
         }
 
-        clear();
         if (uidl.hasAttribute("caption")) {
             setTitle(uidl.getStringAttribute("caption"));
         }
@@ -52,10 +51,16 @@ public class IGridLayout extends FlexTable implements Paintable, Container {
                             Widget child = client.getWidget(u);
                             prepareCell(row, column);
                             Widget oldChild = getWidget(row, column);
+                            if (oldChild instanceof CaptionWrapper) {
+                                CaptionWrapper new_name = (CaptionWrapper) oldChild;
+                                oldChild = (Widget) new_name.getPaintable();
+                            }
                             if (child != oldChild) {
                                 if (oldChild != null) {
-                                    CaptionWrapper cw = (CaptionWrapper) oldChild;
-                                    detachdedPaintables.add(cw.getPaintable());
+                                    detachdedPaintables.add(oldChild);
+                                    CaptionWrapper cw = (CaptionWrapper) widgetToCaptionWrapper
+                                            .get(oldChild);
+                                    cw.removeFromParent();
                                     widgetToCaptionWrapper.remove(oldChild);
                                 }
                                 CaptionWrapper wrapper = new CaptionWrapper(
@@ -63,7 +68,9 @@ public class IGridLayout extends FlexTable implements Paintable, Container {
                                 setWidget(row, column, wrapper);
                                 widgetToCaptionWrapper.put(child, wrapper);
                             }
-                            ((Paintable) child).updateFromUIDL(u, client);
+                            if (!u.getBooleanAttribute("cached")) {
+                                ((Paintable) child).updateFromUIDL(u, client);
+                            }
                         }
                         column += w;
                     }