]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix for #5987 - RequestLayout is called for widgets that are not attached to the DOM
authorArtur Signell <artur.signell@itmill.com>
Fri, 12 Nov 2010 16:35:26 +0000 (16:35 +0000)
committerArtur Signell <artur.signell@itmill.com>
Fri, 12 Nov 2010 16:35:26 +0000 (16:35 +0000)
svn changeset:15979/svn branch:6.5

src/com/vaadin/terminal/gwt/client/Util.java

index 5afbd2f15c3b3293c5eb3766466fb4f5aa7ca249..98caac153b07b0f4d855422fdb0b9ad1e09b177b 100644 (file)
@@ -114,19 +114,24 @@ public class Util {
      * Called when the size of one or more widgets have changed during
      * rendering. Finds parent container and notifies them of the size change.
      * 
-     * @param widgets
+     * @param paintables
      */
-    public static void componentSizeUpdated(Set<Paintable> widgets) {
-        if (widgets.isEmpty()) {
+    public static void componentSizeUpdated(Set<Paintable> paintables) {
+        if (paintables.isEmpty()) {
             return;
         }
 
         Map<Container, Set<Paintable>> childWidgets = new HashMap<Container, Set<Paintable>>();
 
-        for (Paintable widget : widgets) {
+        for (Paintable paintable : paintables) {
+            Widget widget = (Widget) paintable;
+            if (!widget.isAttached()) {
+                continue;
+            }
+
             // ApplicationConnection.getConsole().log(
             // "Widget " + Util.getSimpleName(widget) + " size updated");
-            Widget parent = ((Widget) widget).getParent();
+            Widget parent = widget.getParent();
             while (parent != null && !(parent instanceof Container)) {
                 parent = parent.getParent();
             }
@@ -136,7 +141,7 @@ public class Util {
                     set = new HashSet<Paintable>();
                     childWidgets.put((Container) parent, set);
                 }
-                set.add(widget);
+                set.add(paintable);
             }
         }