diff options
author | Jani Laakso <jani.laakso@itmill.com> | 2008-04-23 13:41:14 +0000 |
---|---|---|
committer | Jani Laakso <jani.laakso@itmill.com> | 2008-04-23 13:41:14 +0000 |
commit | 8df611745ad8df4b5dab963c4f58d0866fb34b5e (patch) | |
tree | 790ec2af2e398b4386573e2af3ba2b09f43d0074 /src | |
parent | 61191d7ea6566ea8e4100095df558256e3d8890a (diff) | |
download | vaadin-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.java | 16 |
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; } } |