]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed ComponentLocator to be backwards compatible
authorArtur Signell <artur@vaadin.com>
Mon, 25 Mar 2013 12:16:59 +0000 (14:16 +0200)
committerArtur Signell <artur@vaadin.com>
Mon, 25 Mar 2013 12:22:12 +0000 (14:22 +0200)
The WAI-ARIA fix (#11180) introduced a new FlowPanel in a PopupDateField popup which is now handled properly.

Change-Id: I192018c95d6d1502e3a50e5c30d4125d467ddf94

client/src/com/vaadin/client/ComponentLocator.java

index 05603e8abe5c521ffecf884fdfec8111acb9a966..543877448a172e8df1676fe6df468072806c69a6 100644 (file)
@@ -28,6 +28,7 @@ import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.client.ui.SubPartAware;
 import com.vaadin.client.ui.VCssLayout;
 import com.vaadin.client.ui.VGridLayout;
+import com.vaadin.client.ui.VOverlay;
 import com.vaadin.client.ui.VTabsheetPanel;
 import com.vaadin.client.ui.VUI;
 import com.vaadin.client.ui.VWindow;
@@ -565,7 +566,8 @@ public class ComponentLocator {
                 // ChildComponentContainer and VOrderedLayout$Slot have been
                 // replaced with Slot
                 if (w instanceof VAbstractOrderedLayout
-                        && ("ChildComponentContainer".equals(widgetClassName) || "VOrderedLayout$Slot"
+                        && ("ChildComponentContainer"
+                                .equals(widgetClassName) || "VOrderedLayout$Slot"
                                 .equals(widgetClassName))) {
                     widgetClassName = "Slot";
                 }
@@ -575,7 +577,12 @@ public class ComponentLocator {
                     // is always 0 which indicates the widget in the active tab
                     widgetPosition = 0;
                 }
-
+                if (w instanceof VOverlay
+                        && "VCalendarPanel".equals(widgetClassName)) {
+                    // Vaadin 7.1 adds a wrapper for datefield popups
+                    parent = (Iterable<?>) ((Iterable) parent).iterator()
+                            .next();
+                }
                 /*
                  * The new grid and ordered layotus do not contain
                  * ChildComponentContainer widgets. This is instead simulated by
@@ -585,7 +592,8 @@ public class ComponentLocator {
                  * ChildComponentContainer)
                  */
                 if ((w instanceof VGridLayout)
-                        && "ChildComponentContainer".equals(widgetClassName)
+                        && "ChildComponentContainer"
+                                .equals(widgetClassName)
                         && i + 1 < parts.length) {
 
                     HasWidgets layout = (HasWidgets) w;