diff options
author | Henri Sara <henri.sara@itmill.com> | 2011-02-23 11:10:59 +0000 |
---|---|---|
committer | Henri Sara <henri.sara@itmill.com> | 2011-02-23 11:10:59 +0000 |
commit | 097fd02fbfbfdf241081087bb055a800398433d3 (patch) | |
tree | 6b2a949550b19366b009078b38aa2e78fb12ead9 /src/com/vaadin/ui/AbsoluteLayout.java | |
parent | 33f6cd47adb0dcc72bdfce3cdeeb6c93a510bea4 (diff) | |
download | vaadin-framework-097fd02fbfbfdf241081087bb055a800398433d3.tar.gz vaadin-framework-097fd02fbfbfdf241081087bb055a800398433d3.zip |
#6493 API for getting the deepest clicked component in layout click events
svn changeset:17390/svn branch:6.5
Diffstat (limited to 'src/com/vaadin/ui/AbsoluteLayout.java')
-rw-r--r-- | src/com/vaadin/ui/AbsoluteLayout.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/vaadin/ui/AbsoluteLayout.java b/src/com/vaadin/ui/AbsoluteLayout.java index 538cc26c77..a30cae529b 100644 --- a/src/com/vaadin/ui/AbsoluteLayout.java +++ b/src/com/vaadin/ui/AbsoluteLayout.java @@ -585,9 +585,14 @@ public class AbsoluteLayout extends AbstractLayout { private void fireClick(Map<String, Object> parameters) { MouseEventDetails mouseDetails = MouseEventDetails .deSerialize((String) parameters.get("mouseDetails")); - Component childComponent = (Component) parameters.get("component"); + Component clickedComponent = (Component) parameters.get("component"); + Component childComponent = clickedComponent; + while (childComponent != null && !components.contains(childComponent)) { + childComponent = childComponent.getParent(); + } - fireEvent(new LayoutClickEvent(this, mouseDetails, childComponent)); + fireEvent(new LayoutClickEvent(this, mouseDetails, clickedComponent, + childComponent)); } /** |