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/AbstractOrderedLayout.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/AbstractOrderedLayout.java')
-rw-r--r-- | src/com/vaadin/ui/AbstractOrderedLayout.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/vaadin/ui/AbstractOrderedLayout.java b/src/com/vaadin/ui/AbstractOrderedLayout.java index 7bd52f8feb..28d6f66792 100644 --- a/src/com/vaadin/ui/AbstractOrderedLayout.java +++ b/src/com/vaadin/ui/AbstractOrderedLayout.java @@ -363,9 +363,14 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements 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)); } /** |