diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2015-04-17 15:15:25 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-04-17 13:34:08 +0000 |
commit | 2d3ed921065acd7761df07b9b403d111bedf33d9 (patch) | |
tree | dc8ec260dfee6ad96e1080e7eb0c8fa8e67e18df /server/src/com/vaadin | |
parent | 6ce22d8ad5c9e81cc2e34a70779413fb2c7040d6 (diff) | |
download | vaadin-framework-2d3ed921065acd7761df07b9b403d111bedf33d9.tar.gz vaadin-framework-2d3ed921065acd7761df07b9b403d111bedf33d9.zip |
Don't clear element content in AbstractComponent.writeDesign (#17488)
WriteDesign now assumes the element it receives is pristine, so elements cannot
be reused without someone else clearing them first. Currently only
DesignContext.createElement directly invokes writeDesign, and it always passes a
new element to it.
Change-Id: Icb777da1d73a28150041914dd9743e7aa0b25e16
Diffstat (limited to 'server/src/com/vaadin')
-rw-r--r-- | server/src/com/vaadin/ui/AbstractComponent.java | 2 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/Component.java | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index dae073904b..3ceb06b31e 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -1239,8 +1239,6 @@ public abstract class AbstractComponent extends AbstractClientConnector */ @Override public void writeDesign(Element design, DesignContext designContext) { - // clear element contents - DesignAttributeHandler.clearElement(design); AbstractComponent def = designContext.getDefaultInstance(this); Attributes attr = design.attributes(); // handle default attributes diff --git a/server/src/com/vaadin/ui/Component.java b/server/src/com/vaadin/ui/Component.java index adef4b69c5..5db48806c3 100644 --- a/server/src/com/vaadin/ui/Component.java +++ b/server/src/com/vaadin/ui/Component.java @@ -747,7 +747,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * * @since 7.4 * @param design - * The design as HTML to obtain the state from + * The element to obtain the state from * @param designContext * The DesignContext instance used for parsing the design */ @@ -763,8 +763,11 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * * @since 7.4 * @param design - * The design as HTML to update with the current state + * The element to write the component state to. Any previous + * attributes or child nodes are <i>not</i> cleared. * @param designContext + * The DesignContext instance used for writing the design + * */ public void writeDesign(Element design, DesignContext designContext); |