]> source.dussan.org Git - vaadin-framework.git/commitdiff
Unified logic in getting dirty connectors to ensure invisible connectors are never...
authorArtur Signell <artur@vaadin.com>
Wed, 21 Mar 2012 12:33:58 +0000 (14:33 +0200)
committerArtur Signell <artur@vaadin.com>
Wed, 21 Mar 2012 13:28:17 +0000 (15:28 +0200)
src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
src/com/vaadin/ui/AbstractComponent.java

index 0c073f71b4ad338147070cc99d98f987b329eebd..c41c41b4c2d45b915263451c1752cc8d853d0709 100644 (file)
@@ -780,19 +780,14 @@ public abstract class AbstractCommunicationManager implements
 
             rootConnectorTracker.markAllComponentsDirty();
 
-            dirtyVisibleConnectors.addAll(rootConnectorTracker
-                    .getDirtyComponents());
-
             // Reset sent locales
             locales = null;
             requireLocale(application.getLocale().toString());
-
-        } else {
-            // TODO second list/stack for those whose state needs to be sent?
-            dirtyVisibleConnectors
-                    .addAll(getDirtyVisibleComponents(rootConnectorTracker));
         }
 
+        dirtyVisibleConnectors
+                .addAll(getDirtyVisibleComponents(rootConnectorTracker));
+
         System.out.println("* Found " + dirtyVisibleConnectors.size()
                 + " dirty connectors to paint");
         rootConnectorTracker.markAllComponentsClean();
index ad91f342bada127210a47f0152d03ca58e0dec25..0bf4d935d44509f8caf22d88f2c7c8994a9dae2a 100644 (file)
@@ -739,6 +739,7 @@ public abstract class AbstractComponent implements Component, MethodEventSource
      *             if the paint operation failed.
      */
     public void paint(PaintTarget target) throws PaintException {
+        // Only paint content of visible components.
         if (!isVisibleInContext()) {
             return;
         }
@@ -751,18 +752,11 @@ public abstract class AbstractComponent implements Component, MethodEventSource
             target.addAttribute("deferred", true);
         } else {
             // Paint the contents of the component
+            paintContent(target);
 
-            // Only paint content of visible components.
-            if (isVisibleInContext()) {
-
-                paintContent(target);
-
-                final ErrorMessage error = getErrorMessage();
-                if (error != null) {
-                    error.paint(target);
-                }
-            } else {
-                target.addAttribute("invisible", true);
+            final ErrorMessage error = getErrorMessage();
+            if (error != null) {
+                error.paint(target);
             }
         }
         target.endPaintable(this);
@@ -786,6 +780,10 @@ public abstract class AbstractComponent implements Component, MethodEventSource
             }
             p = p.getParent();
         }
+        if (getParent() != null && !getParent().isComponentVisible(this)) {
+            return false;
+        }
+
         // All parents visible, return this state
         return isVisible();
     }