]> source.dussan.org Git - vaadin-framework.git/commitdiff
Update ComponentLocator for changed GridLayout widget structure (#8313)
authorLeif Åstrand <leif@vaadin.com>
Wed, 22 Feb 2012 09:38:55 +0000 (11:38 +0200)
committerLeif Åstrand <leif@vaadin.com>
Wed, 22 Feb 2012 09:38:55 +0000 (11:38 +0200)
src/com/vaadin/terminal/gwt/client/ComponentLocator.java

index 51e600abafd50f330d57cc952c019554e8aadb9c..3b4821cc0fd8536d5eec89412ced5dafb620840c 100644 (file)
@@ -12,6 +12,7 @@ import com.google.gwt.user.client.ui.HasWidgets;
 import com.google.gwt.user.client.ui.RootPanel;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ui.SubPartAware;
+import com.vaadin.terminal.gwt.client.ui.VGridLayout;
 import com.vaadin.terminal.gwt.client.ui.VMeasuringOrderedLayout;
 import com.vaadin.terminal.gwt.client.ui.VView;
 import com.vaadin.terminal.gwt.client.ui.VWindow;
@@ -458,19 +459,25 @@ public class ComponentLocator {
                 int widgetPosition = Integer.parseInt(indexString.substring(0,
                         indexString.length() - 1));
 
+                // AbsolutePanel in GridLayout has been removed -> skip it
+                if (w instanceof VGridLayout
+                        && "AbsolutePanel".equals(widgetClassName)) {
+                    continue;
+                }
+
                 /*
-                 * The new ordered layotus do not contain
+                 * The new grid and ordered layotus do not contain
                  * ChildComponentContainer widgets. This is instead simulated by
                  * constructing a path step that would find the desired widget
                  * from the layout and injecting it as the next search step
                  * (which would originally have found the widget inside the
                  * ChildComponentContainer)
                  */
-                if (w instanceof VMeasuringOrderedLayout
+                if ((w instanceof VMeasuringOrderedLayout || w instanceof VGridLayout)
                         && "ChildComponentContainer".equals(widgetClassName)
                         && i + 1 < parts.length) {
 
-                    VMeasuringOrderedLayout layout = (VMeasuringOrderedLayout) w;
+                    HasWidgets layout = (HasWidgets) w;
 
                     String nextPart = parts[i + 1];
                     String[] nextSplit = nextPart.split("\\[", 2);