summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Alhroos <john.ahlroos@itmill.com>2011-03-08 11:24:58 +0000
committerJohn Alhroos <john.ahlroos@itmill.com>2011-03-08 11:24:58 +0000
commit26f45c0e223edcc4d07e24b242d250ddd91dd555 (patch)
treebdd7aba91c055865cea6b1575a481315ce74b670 /src
parentb6d8523b70f5ed167075bd5a5ebebbd66505b908 (diff)
downloadvaadin-framework-26f45c0e223edcc4d07e24b242d250ddd91dd555.tar.gz
vaadin-framework-26f45c0e223edcc4d07e24b242d250ddd91dd555.zip
Fixes #6368
svn changeset:17663/svn branch:6.5
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/ui/AbsoluteLayout.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/com/vaadin/ui/AbsoluteLayout.java b/src/com/vaadin/ui/AbsoluteLayout.java
index 3b0239af7b..8f9d65bd72 100644
--- a/src/com/vaadin/ui/AbsoluteLayout.java
+++ b/src/com/vaadin/ui/AbsoluteLayout.java
@@ -122,8 +122,22 @@ public class AbsoluteLayout extends AbstractLayout implements
* The css position string
*/
public void addComponent(Component c, String cssPosition) {
- addComponent(c);
- getPosition(c).setCSSString(cssPosition);
+ /*
+ * Create position instance and add it to componentToCoordinates map. We
+ * need to do this before we call addComponent so the attachListeners
+ * can access this position. #6368
+ */
+ componentToCoordinates.put(c, new ComponentPosition());
+ componentToCoordinates.get(c).setCSSString(cssPosition);
+
+ try {
+ addComponent(c);
+
+ } catch (IllegalArgumentException e) {
+ // Remove component coordinates if adding fails
+ componentToCoordinates.remove(c);
+ throw e;
+ }
}
/**