From 5833ae25ec617e2ea93eeef669b2fd247d8f394c Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Mon, 3 Sep 2012 12:56:53 +0300 Subject: [PATCH] Fixed component locator for box layouts --- client/src/com/vaadin/client/ComponentLocator.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/src/com/vaadin/client/ComponentLocator.java b/client/src/com/vaadin/client/ComponentLocator.java index dabea6c8d7..c286b2fb9d 100644 --- a/client/src/com/vaadin/client/ComponentLocator.java +++ b/client/src/com/vaadin/client/ComponentLocator.java @@ -23,6 +23,7 @@ import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.ui.HasWidgets; import com.google.gwt.user.client.ui.RootPanel; +import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.ui.SubPartAware; import com.vaadin.client.ui.UI.VUI; @@ -516,7 +517,8 @@ public class ComponentLocator { * (which would originally have found the widget inside the * ChildComponentContainer) */ - if ((w instanceof VMeasuringOrderedLayout || w instanceof VGridLayout) + if ((w instanceof VMeasuringOrderedLayout + || w instanceof VBoxLayout || w instanceof VGridLayout) && "ChildComponentContainer".equals(widgetClassName) && i + 1 < parts.length) { @@ -585,8 +587,14 @@ public class ComponentLocator { while (iterator.hasNext()) { Widget child = iterator.next(); + String simpleName2 = Util.getSimpleName(child); + if (simpleName2.equals("VBoxLayout$Slot")) { + child = ((SimplePanel) child).getWidget(); + simpleName2 = Util.getSimpleName(child); + } + if (widgetClassName.equals(simpleName2)) { if (widgetPosition == 0) { w = child; -- 2.39.5