From 2d3ed921065acd7761df07b9b403d111bedf33d9 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Fri, 17 Apr 2015 15:15:25 +0300 Subject: 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 --- server/src/com/vaadin/ui/AbstractComponent.java | 2 -- server/src/com/vaadin/ui/Component.java | 7 +++++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'server/src/com/vaadin/ui') 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 not cleared. * @param designContext + * The DesignContext instance used for writing the design + * */ public void writeDesign(Element design, DesignContext designContext); -- cgit v1.2.3