summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJani Laakso <jani.laakso@itmill.com>2008-04-23 13:41:14 +0000
committerJani Laakso <jani.laakso@itmill.com>2008-04-23 13:41:14 +0000
commit8df611745ad8df4b5dab963c4f58d0866fb34b5e (patch)
tree790ec2af2e398b4386573e2af3ba2b09f43d0074 /src
parent61191d7ea6566ea8e4100095df558256e3d8890a (diff)
downloadvaadin-framework-8df611745ad8df4b5dab963c4f58d0866fb34b5e.tar.gz
vaadin-framework-8df611745ad8df4b5dab963c4f58d0866fb34b5e.zip
Fixed #1590: AbstractComponentContainer and CustomComponent setCompositionRoot throws exception
svn changeset:4208/svn branch:trunk
Diffstat (limited to 'src')
-rw-r--r--src/com/itmill/toolkit/ui/CustomComponent.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/com/itmill/toolkit/ui/CustomComponent.java b/src/com/itmill/toolkit/ui/CustomComponent.java
index 4815c3561b..cd5c6725d4 100644
--- a/src/com/itmill/toolkit/ui/CustomComponent.java
+++ b/src/com/itmill/toolkit/ui/CustomComponent.java
@@ -83,12 +83,16 @@ public class CustomComponent extends AbstractComponentContainer {
* the root of the composition component tree.
*/
protected final void setCompositionRoot(Component compositionRoot) {
- if (compositionRoot != root && root != null) {
- super.removeComponent(root);
- }
- root = compositionRoot;
- if (root != null) {
- super.addComponent(root);
+ if (compositionRoot != root) {
+ if (root != null) {
+ // remove old component
+ super.removeComponent(root);
+ }
+ if (compositionRoot != null) {
+ // set new component
+ super.addComponent(compositionRoot);
+ }
+ root = compositionRoot;
}
}