diff options
author | Matti Hosio <mhosio@vaadin.com> | 2014-12-16 14:29:08 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-12-16 14:22:48 +0000 |
commit | 1bfb901ad434d295f775c2fe34ac2cad4b2924e4 (patch) | |
tree | aea34e8bd9e9edf7a85e0a0e75bce9d903a642e5 /server/src | |
parent | 4db93af2d3f57809e3a9c66d72a398379afc2573 (diff) | |
download | vaadin-framework-1bfb901ad434d295f775c2fe34ac2cad4b2924e4.tar.gz vaadin-framework-1bfb901ad434d295f775c2fe34ac2cad4b2924e4.zip |
Do not write child components in sub templates (#7749)
Change-Id: I7e19e86618bbf27ae3a6e585bab000f26dd8f6d5
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/com/vaadin/ui/AbsoluteLayout.java | 4 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/AbstractSingleComponentContainer.java | 5 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/AbstractSplitPanel.java | 3 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/CssLayout.java | 4 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/TabSheet.java | 3 |
5 files changed, 19 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/AbsoluteLayout.java b/server/src/com/vaadin/ui/AbsoluteLayout.java index 01c1aea788..27ddb86dad 100644 --- a/server/src/com/vaadin/ui/AbsoluteLayout.java +++ b/server/src/com/vaadin/ui/AbsoluteLayout.java @@ -718,6 +718,10 @@ public class AbsoluteLayout extends AbstractLayout implements @Override public void writeDesign(Element design, DesignContext designContext) { super.writeDesign(design, designContext); + AbsoluteLayout def = designContext.getDefaultInstance(this); + if (!designContext.shouldWriteChildren(this, def)) { + return; + } // handle children for (Component child : this) { Element childElement = designContext.createElement(child); diff --git a/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java b/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java index a646f17f23..034c285670 100644 --- a/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java +++ b/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java @@ -312,6 +312,11 @@ public abstract class AbstractSingleComponentContainer extends public void writeDesign(Element design, DesignContext designContext) { // synchronize default attributes (also clears children and attributes) super.writeDesign(design, designContext); + AbstractSingleComponentContainer def = designContext + .getDefaultInstance(this); + if (!designContext.shouldWriteChildren(this, def)) { + return; + } // handle child component Component child = getContent(); if (child != null) { diff --git a/server/src/com/vaadin/ui/AbstractSplitPanel.java b/server/src/com/vaadin/ui/AbstractSplitPanel.java index 3daf759c30..29dbadecc4 100644 --- a/server/src/com/vaadin/ui/AbstractSplitPanel.java +++ b/server/src/com/vaadin/ui/AbstractSplitPanel.java @@ -649,6 +649,9 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { design.attr("reversed", ""); } // handle child components + if (!designContext.shouldWriteChildren(this, def)) { + return; + } Component firstComponent = getFirstComponent(); Component secondComponent = getSecondComponent(); if (firstComponent != null) { diff --git a/server/src/com/vaadin/ui/CssLayout.java b/server/src/com/vaadin/ui/CssLayout.java index 541d369c55..9a4da009e9 100644 --- a/server/src/com/vaadin/ui/CssLayout.java +++ b/server/src/com/vaadin/ui/CssLayout.java @@ -388,7 +388,11 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { public void writeDesign(Element design, DesignContext designContext) { // synchronize default attributes super.writeDesign(design, designContext); + CssLayout def = designContext.getDefaultInstance(this); // handle children + if (!designContext.shouldWriteChildren(this, def)) { + return; + } Element designElement = design; for (Component child : this) { Element childNode = designContext.createElement(child); diff --git a/server/src/com/vaadin/ui/TabSheet.java b/server/src/com/vaadin/ui/TabSheet.java index 6bd5ef2221..e4060528ee 100644 --- a/server/src/com/vaadin/ui/TabSheet.java +++ b/server/src/com/vaadin/ui/TabSheet.java @@ -1613,6 +1613,9 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, Attributes attr = design.attributes(); // write tabs + if (!designContext.shouldWriteChildren(this, def)) { + return; + } for (Component component : this) { Tab tab = this.getTab(component); writeTabToDesign(design, designContext, tab); |