summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2013-06-13 10:29:57 +0300
committerVaadin Code Review <review@vaadin.com>2013-06-13 08:03:50 +0000
commit55ebe132a2e50695944cf172c36fcfcf3377d1b2 (patch)
tree5acb174259291115e34b7953f206832a94360dc0 /client
parent0aa59071569bfcb7920c28b701f5b433881819d5 (diff)
downloadvaadin-framework-55ebe132a2e50695944cf172c36fcfcf3377d1b2.tar.gz
vaadin-framework-55ebe132a2e50695944cf172c36fcfcf3377d1b2.zip
Detach and attach when adding or removing the caption wrapper (#11708)
Change-Id: Ie6de4863587189ef1105cc41211b224c126f6ebd
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/orderedlayout/Slot.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/src/com/vaadin/client/ui/orderedlayout/Slot.java b/client/src/com/vaadin/client/ui/orderedlayout/Slot.java
index 00ff5bbc5a..49b3661431 100644
--- a/client/src/com/vaadin/client/ui/orderedlayout/Slot.java
+++ b/client/src/com/vaadin/client/ui/orderedlayout/Slot.java
@@ -455,6 +455,7 @@ public final class Slot extends SimplePanel {
// since last time, and only run those changes
// Caption wrappers
+ Widget widget = getWidget();
if (captionText != null || iconUrl != null || error != null || required) {
if (caption == null) {
caption = DOM.createDiv();
@@ -462,10 +463,14 @@ public final class Slot extends SimplePanel {
captionWrap.addClassName(StyleConstants.UI_WIDGET);
captionWrap.addClassName("v-has-caption");
getElement().appendChild(captionWrap);
- captionWrap.appendChild(getWidget().getElement());
+ orphan(widget);
+ captionWrap.appendChild(widget.getElement());
+ adopt(widget);
}
} else if (caption != null) {
- getElement().appendChild(getWidget().getElement());
+ orphan(widget);
+ getElement().appendChild(widget.getElement());
+ adopt(widget);
captionWrap.removeFromParent();
caption = null;
captionWrap = null;