diff options
author | Artur Signell <artur@vaadin.com> | 2012-03-21 14:33:58 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-03-21 15:28:17 +0200 |
commit | 5efc842094c837b3396aab35f855ca899ee1b74b (patch) | |
tree | 2b20ad3d62776568672a9e039789ee453ff05cd3 /src/com/vaadin/ui/AbstractComponent.java | |
parent | 08987be4c28f017098662a63e6f2527027328af5 (diff) | |
download | vaadin-framework-5efc842094c837b3396aab35f855ca899ee1b74b.tar.gz vaadin-framework-5efc842094c837b3396aab35f855ca899ee1b74b.zip |
Unified logic in getting dirty connectors to ensure invisible connectors are never sent to the client. Also fixed isVisibleInContext to take parent restrictions into account and removed extra code.
Diffstat (limited to 'src/com/vaadin/ui/AbstractComponent.java')
-rw-r--r-- | src/com/vaadin/ui/AbstractComponent.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/com/vaadin/ui/AbstractComponent.java b/src/com/vaadin/ui/AbstractComponent.java index ad91f342ba..0bf4d935d4 100644 --- a/src/com/vaadin/ui/AbstractComponent.java +++ b/src/com/vaadin/ui/AbstractComponent.java @@ -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(); } |