From 117f56a1ba2d4f857220f12f34c1bb51626cfbf3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johannes=20Dahlstr=C3=B6m?= Date: Thu, 26 Jul 2012 16:08:05 +0300 Subject: [PATCH] Actually we still need the VOverlay special case for situations where an overlay does not have a corresponding connector (eg. submenus) (#9172) --- src/com/vaadin/terminal/gwt/client/Util.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java index 37a0b84094..9b085b3067 100644 --- a/src/com/vaadin/terminal/gwt/client/Util.java +++ b/src/com/vaadin/terminal/gwt/client/Util.java @@ -29,6 +29,7 @@ import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.RenderInformation.FloatSize; import com.vaadin.terminal.gwt.client.communication.MethodInvocation; +import com.vaadin.terminal.gwt.client.ui.VOverlay; public class Util { @@ -648,6 +649,7 @@ public class Util { Element rootElement = parent.getElement(); while (browseElement != null && browseElement != rootElement) { + ComponentConnector connector = ConnectorMap.get(client) .getConnector(browseElement); @@ -674,7 +676,15 @@ public class Util { browseElement = (Element) browseElement.getParentElement(); } - return null; + // No connector found, element is possibly inside a VOverlay + // If the overlay has an owner, try to find the owner's connector + VOverlay overlay = findWidget(element, VOverlay.class); + if (overlay != null && overlay.getOwner() != null) { + return getConnectorForElement(client, RootPanel.get(), overlay + .getOwner().getElement()); + } else { + return null; + } } /** -- 2.39.5