]> source.dussan.org Git - vaadin-framework.git/commitdiff
Overlay container #9220 85/185/1
authorMarc Englund <marc@vaadin.com>
Mon, 29 Oct 2012 15:10:21 +0000 (17:10 +0200)
committerMarc Englund <marc@vaadin.com>
Tue, 30 Oct 2012 13:45:25 +0000 (15:45 +0200)
Change-Id: Iea5b44fc0c48ec1161890d9e084847266ce0d3d2

25 files changed:
WebContent/VAADIN/themes/chameleon/components/notification/notification.scss
WebContent/VAADIN/themes/reindeer/notification/notification.scss
client/src/com/vaadin/VaadinBrowserSpecificOverrides.gwt.xml
client/src/com/vaadin/client/ApplicationConfiguration.java
client/src/com/vaadin/client/ApplicationConnection.java
client/src/com/vaadin/client/LayoutManager.java
client/src/com/vaadin/client/Util.java
client/src/com/vaadin/client/VDebugConsole.java
client/src/com/vaadin/client/VErrorMessage.java
client/src/com/vaadin/client/VTooltip.java
client/src/com/vaadin/client/ui/VOverlay.java
client/src/com/vaadin/client/ui/VPopupImpl.java [new file with mode: 0644]
client/src/com/vaadin/client/ui/VPopupImplMozilla.java [new file with mode: 0644]
client/src/com/vaadin/client/ui/combobox/VFilterSelect.java
client/src/com/vaadin/client/ui/datefield/VPopupCalendar.java
client/src/com/vaadin/client/ui/form/VForm.java
client/src/com/vaadin/client/ui/menubar/MenuBar.java
client/src/com/vaadin/client/ui/menubar/VMenuBar.java
client/src/com/vaadin/client/ui/notification/VNotification.java
client/src/com/vaadin/client/ui/popupview/VPopupView.java
client/src/com/vaadin/client/ui/slider/VSlider.java
client/src/com/vaadin/client/ui/window/VWindow.java
client/src/com/vaadin/client/ui/window/WindowConnector.java
uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/CapsLockWarningConnector.java
uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningWithRpcConnector.java

index 9036c5c2d63c761a1d44fbe447c43c9dcee36a3a..020c29ed09f83e4d32dfd819f6272fa2be64dcda 100644 (file)
@@ -4,7 +4,7 @@ div.v-Notification {
        -moz-border-radius: 0;
        -webkit-border-radius: 0;
        border-radius: 0;
-       font-size: 100%;
+       font-size: 16px; 
        -webkit-box-shadow: 0 2px 5px rgba(0,0,0,.7);
        -moz-box-shadow: 0 2px 5px rgba(0,0,0,.7);
        box-shadow: 0 2px 5px rgba(0,0,0,.7);
index 464faa8aab72ac8bf72ab8482559790ef2ab7d88..aafff47e96193b0df95e45cf0570a10c4e0eeb0f 100644 (file)
@@ -5,7 +5,7 @@
        border-radius: 4px;
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
-       font-size: 100%;
+       font-size: 16px;
        background: #c8ccd0;
        font-weight: bold;
 }
index 9b3049a60cf4f8abe711aac5993332945bca2a62..09b901ec3846abf536f6c04a7bf6eced0d84d7f9 100644 (file)
                        <when-property-is name="user.agent" value="ie8" />
                </any>
        </replace-with>
+       
+       <replace-with class="com.vaadin.client.ui.VPopupImpl">
+       <when-type-is class="com.google.gwt.user.client.ui.impl.PopupImplMozilla" />
+       <when-property-is name="user.agent" value="gecko1_8"/>
+    </replace-with>
+    
+    <replace-with class="com.vaadin.client.ui.VPopupImpl">
+        <when-type-is class="com.google.gwt.user.client.ui.impl.PopupImpl" />
+    </replace-with>
 
 </module>
index 1432e1d5ccb7a7921ca6cf4864c6f65e50fdc82f..4159b382112fb400b16be1787ff22ca5dbeae461 100644 (file)
@@ -378,8 +378,8 @@ public class ApplicationConfiguration implements EntryPoint {
                 ApplicationConnection a = GWT
                         .create(ApplicationConnection.class);
                 a.init(widgetSet, appConf);
-                a.start();
                 runningApplications.add(a);
+                a.start();
             }
         });
     }
index 750e733b511082bbf52e8c786bf733b61cb0f7f2..b43ed6c9faeebe7c50a14c866988a6c212497def 100644 (file)
@@ -343,6 +343,7 @@ public class ApplicationConnection {
         rpcManager = GWT.create(RpcManager.class);
         layoutManager = GWT.create(LayoutManager.class);
         layoutManager.setConnection(this);
+        tooltip = GWT.create(VTooltip.class);
     }
 
     public void init(WidgetSet widgetSet, ApplicationConfiguration cnf) {
@@ -371,6 +372,9 @@ public class ApplicationConnection {
         initializeClientHooks();
 
         uIConnector.init(cnf.getRootPanelId(), this);
+
+        tooltip.setOwner(uIConnector.getWidget());
+
         showLoadingIndicator();
 
         scheduleHeartbeat();
@@ -926,7 +930,8 @@ public class ApplicationConnection {
             html.append(details);
             html.append("</I></p>");
 
-            VNotification n = VNotification.createNotification(1000 * 60 * 45);
+            VNotification n = VNotification.createNotification(1000 * 60 * 45,
+                    uIConnector.getWidget());
             n.addEventListener(new NotificationRedirect(url));
             n.show(html.toString(), VNotification.CENTERED_TOP,
                     VNotification.STYLE_SYSTEM);
@@ -1375,8 +1380,8 @@ public class ApplicationConnection {
 
                         if (html.length() != 0) {
                             /* 45 min */
-                            VNotification n = VNotification
-                                    .createNotification(1000 * 60 * 45);
+                            VNotification n = VNotification.createNotification(
+                                    1000 * 60 * 45, uIConnector.getWidget());
                             n.addEventListener(new NotificationRedirect(url));
                             n.show(html, VNotification.CENTERED_TOP,
                                     VNotification.STYLE_SYSTEM);
@@ -2578,6 +2583,7 @@ public class ApplicationConnection {
     public VContextMenu getContextMenu() {
         if (contextMenu == null) {
             contextMenu = new VContextMenu();
+            contextMenu.setOwner(uIConnector.getWidget());
             DOM.setElementProperty(contextMenu.getElement(), "id",
                     "PID_VAADIN_CM");
         }
@@ -2680,7 +2686,7 @@ public class ApplicationConnection {
 
     /* Extended title handling */
 
-    private final VTooltip tooltip = new VTooltip(this);
+    private final VTooltip tooltip;
 
     private ConnectorMap connectorMap = GWT.create(ConnectorMap.class);
 
index 1106d6eae28d6f68a283dcdc549ee813ae8a5f5a..9ed8f261e7f274730828ed821fa3f8c40111de9d 100644 (file)
@@ -400,9 +400,9 @@ public class LayoutManager {
 
             if (passes > 100) {
                 VConsole.log(LOOP_ABORT_MESSAGE);
-                VNotification.createNotification(VNotification.DELAY_FOREVER)
-                        .show(LOOP_ABORT_MESSAGE, VNotification.CENTERED,
-                                "error");
+                VNotification.createNotification(VNotification.DELAY_FOREVER,
+                        connection.getRootConnector().getWidget()).show(
+                        LOOP_ABORT_MESSAGE, VNotification.CENTERED, "error");
                 break;
             }
         }
index bf4dca7712e1f1e2a8e98f76970199f6e4659e64..c9fe22528d9fe2e682bbdfd37427e62576f4d58b 100644 (file)
@@ -114,7 +114,7 @@ public class Util {
         }
     }
 
-    private static ComponentConnector findConnectorFor(Widget widget) {
+    public static ComponentConnector findConnectorFor(Widget widget) {
         List<ApplicationConnection> runningApplications = ApplicationConfiguration
                 .getRunningApplications();
         for (ApplicationConnection applicationConnection : runningApplications) {
@@ -702,8 +702,9 @@ public class Util {
         // 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());
+
+            return getConnectorForElement(client, client.getRootConnector()
+                    .getWidget(), overlay.getOwner().getElement());
         } else {
             return null;
         }
index 0d1c6d89f6434aab7500eb8ff6f33bc30db1c083..a5dbc9ede58a417285e5701b03296766f9ddae7b 100644 (file)
@@ -694,8 +694,8 @@ public class VDebugConsole extends VOverlay implements Console {
             e.printStackTrace();
         }
         try {
-            VNotification.createNotification(VNotification.DELAY_FOREVER).show(
-                    "<h1>Uncaught client side exception</h1><br />"
+            VNotification.createNotification(VNotification.DELAY_FOREVER, null)
+                    .show("<h1>Uncaught client side exception</h1><br />"
                             + exceptionText, VNotification.CENTERED, "error");
         } catch (Exception e2) {
             // Just swallow this exception
index 3e3807a5dadc8f48a6c896d7c725af7c25cebc0b..a1823b3bc945aeaca2a573bf0405aff004a91d10 100644 (file)
@@ -20,16 +20,33 @@ import com.google.gwt.user.client.DOM;
 import com.google.gwt.user.client.Element;
 import com.google.gwt.user.client.ui.FlowPanel;
 import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.client.ui.VOverlay;
 
 public class VErrorMessage extends FlowPanel {
     public static final String CLASSNAME = "v-errormessage";
 
+    private Widget owner;
+
     public VErrorMessage() {
         super();
         setStyleName(CLASSNAME);
     }
 
+    /**
+     * Set the owner, i.e the Widget that created this {@link VErrorMessage}.
+     * The owner must be set if the {@link VErrorMessage} is created
+     * 'stand-alone' (not within a {@link VOverlay}), or theming might not work
+     * properly.
+     * 
+     * @see VOverlay#setOwner(Widget)
+     * @param owner
+     *            the owner (creator Widget)
+     */
+    public void setOwner(Widget owner) {
+        this.owner = owner;
+    }
+
     public void updateMessage(String htmlErrorMessage) {
         clear();
         if (htmlErrorMessage == null || htmlErrorMessage.length() == 0) {
@@ -50,6 +67,7 @@ public class VErrorMessage extends FlowPanel {
         if (errorContainer == null) {
             errorContainer = new VOverlay();
             errorContainer.setWidget(this);
+            errorContainer.setOwner(owner);
         }
         errorContainer.setPopupPosition(
                 DOM.getAbsoluteLeft(indicatorElement)
index 8de559264df44a0a74b7af08692737ce0ed0be3f..a4c4766e4fa3ee57632948f3fc6ef42e82e6ca49 100644 (file)
@@ -50,13 +50,19 @@ public class VTooltip extends VOverlay {
 
     private boolean closing = false;
     private boolean opening = false;
-    private ApplicationConnection ac;
+
     // Open next tooltip faster. Disabled after 2 sec of showTooltip-silence.
     private boolean justClosed = false;
 
-    public VTooltip(ApplicationConnection client) {
+    /**
+     * Used to show tooltips; usually used via the singleton in
+     * {@link ApplicationConnection}. NOTE that #setOwner(Widget)} should be
+     * called after instantiating.
+     * 
+     * @see ApplicationConnection#getVTooltip()
+     */
+    public VTooltip() {
         super(false, false, true);
-        ac = client;
         setStyleName(CLASSNAME);
         FlowPanel layout = new FlowPanel();
         setWidget(layout);
@@ -268,6 +274,7 @@ public class VTooltip extends VOverlay {
          */
         private boolean resolveConnector(Element element) {
 
+            ApplicationConnection ac = getApplicationConnection();
             ComponentConnector connector = Util.getConnectorForElement(ac,
                     RootPanel.get(), element);
 
index 6dfcd97516919cc618936b71808d5c7fbd466562..064e9fae44f92864bab7a619cf39139d45704794 100644 (file)
@@ -30,7 +30,10 @@ import com.google.gwt.user.client.Element;
 import com.google.gwt.user.client.ui.PopupPanel;
 import com.google.gwt.user.client.ui.RootPanel;
 import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.client.ApplicationConnection;
 import com.vaadin.client.BrowserInfo;
+import com.vaadin.client.ComponentConnector;
+import com.vaadin.client.Util;
 
 /**
  * In Vaadin UI this Overlay should always be used for all elements that
@@ -126,6 +129,15 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> {
      */
     private Widget owner;
 
+    /*
+     * ApplicationConnection that this overlay belongs to, which is needed to
+     * create the overlay in the correct container so that the correct styles
+     * are applied. If not given, owner will be used to figure out, and as a
+     * last fallback, the overlay is created w/o container, potentially missing
+     * styles.
+     */
+    protected ApplicationConnection ac;
+
     /**
      * The shim iframe behind the overlay, allowing PDFs and applets to be
      * covered by overlays.
@@ -328,14 +340,25 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> {
         return leftFix;
     }
 
+    /*
+     * A "thread local" of sorts, set temporarily so that VOverlayImpl knows
+     * which VOverlay is using it, so that it can be attached to the correct
+     * overlay container.
+     * 
+     * TODO this is a strange pattern that we should get rid of when possible.
+     */
+    protected static VOverlay current;
+
     @Override
     public void show() {
+        current = this;
         super.show();
         if (isAnimationEnabled()) {
             new ResizeAnimation().run(POPUP_PANEL_ANIMATION_DURATION);
         } else {
             positionOrSizeUpdated(1.0);
         }
+        current = null;
     }
 
     @Override
@@ -482,14 +505,14 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> {
                             DOM.getChild(shadow, 5).getOffsetHeight());
         }
 
+        Element container = getElement().getParentElement().cast();
         // Attach to dom if not there already
         if (isShadowEnabled() && !isShadowAttached()) {
-            RootPanel.get().getElement().insertBefore(shadow, getElement());
+            container.insertBefore(shadow, getElement());
             sinkShadowEvents();
         }
         if (needsShimElement() && !isShimElementAttached()) {
-            RootPanel.get().getElement()
-                    .insertBefore(getShimElement(), getElement());
+            container.insertBefore(getShimElement(), getElement());
         }
 
     }
@@ -592,4 +615,54 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> {
     public void setOwner(Widget owner) {
         this.owner = owner;
     }
+
+    /**
+     * Get the {@link ApplicationConnection} that this overlay belongs to. If
+     * it's not set, {@link #getOwner()} is used to figure it out.
+     * 
+     * @return
+     */
+    protected ApplicationConnection getApplicationConnection() {
+        if (ac != null) {
+            return ac;
+        } else if (owner != null) {
+            ComponentConnector c = Util.findConnectorFor(owner);
+            if (c != null) {
+                ac = c.getConnection();
+            }
+            return ac;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Gets the 'overlay container' element pertaining to the given
+     * {@link ApplicationConnection}. Each overlay should be created in a
+     * overlay container element, so that the correct theme and styles can be
+     * applied.
+     * 
+     * @param ac
+     * @return
+     */
+    public Element getOverlayContainer() {
+        ApplicationConnection ac = getApplicationConnection();
+        if (ac == null) {
+            // could not figure out which one we belong to, styling might fail
+            return RootPanel.get().getElement();
+        } else {
+            String id = ac.getConfiguration().getRootPanelId();
+            id = id += "-overlays";
+            Element container = DOM.getElementById(id);
+            if (container == null) {
+                container = DOM.createDiv();
+                container.setId(id);
+                String styles = ac.getRootConnector().getWidget().getParent()
+                        .getStyleName();
+                container.setClassName(styles);
+                RootPanel.get().getElement().appendChild(container);
+            }
+            return container;
+        }
+    }
 }
diff --git a/client/src/com/vaadin/client/ui/VPopupImpl.java b/client/src/com/vaadin/client/ui/VPopupImpl.java
new file mode 100644 (file)
index 0000000..842025a
--- /dev/null
@@ -0,0 +1,17 @@
+package com.vaadin.client.ui;
+
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.user.client.ui.impl.PopupImpl;
+
+public class VPopupImpl extends PopupImpl {
+
+    @Override
+    public void onShow(Element popup) {
+        // Move the overlay to the appropriate overlay container
+        Element e = VOverlay.current.getOverlayContainer();
+        e.appendChild(popup);
+
+        super.onShow(popup);
+    }
+
+}
diff --git a/client/src/com/vaadin/client/ui/VPopupImplMozilla.java b/client/src/com/vaadin/client/ui/VPopupImplMozilla.java
new file mode 100644 (file)
index 0000000..4e5b46f
--- /dev/null
@@ -0,0 +1,17 @@
+package com.vaadin.client.ui;
+
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.user.client.ui.impl.PopupImplMozilla;
+
+public class VPopupImplMozilla extends PopupImplMozilla {
+
+    @Override
+    public void onShow(Element popup) {
+        // Move the overlay to the appropriate overlay container
+        Element e = VOverlay.current.getOverlayContainer();
+        e.appendChild(popup);
+
+        super.onShow(popup);
+    }
+
+}
index c08371af953ff04967f71a108998c714b07b34f3..4241daca6f25037b0cd8ab5a0c14b1854af5125d 100644 (file)
@@ -201,6 +201,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler,
          */
         SuggestionPopup() {
             super(true, false, true);
+            setOwner(VFilterSelect.this);
             menu = new SuggestionMenu();
             setWidget(menu);
 
index 0762b965e1845d1065d511eb60e69c72e79ed924..05f1d004f8c03bf8bcfd980b38682437fd566ec3 100644 (file)
@@ -102,6 +102,8 @@ public class VPopupCalendar extends VTextualDate implements Field,
         });
 
         popup = new VOverlay(true, true, true);
+        popup.setOwner(this);
+
         popup.setWidget(calendar);
         popup.addCloseHandler(this);
 
index eb206e75b9a4863bd7b311a9e595e62bd9bfd6a4..ac877bd12fb3d3c0c54b6faac148bf29fbba30d2 100644 (file)
@@ -72,6 +72,8 @@ public class VForm extends ComplexPanel implements KeyDownHandler {
 
         fieldSet.appendChild(errorMessage.getElement());
         fieldSet.appendChild(footerContainer);
+
+        errorMessage.setOwner(this);
     }
 
     @Override
index c5ea865e2f7ef00eaf06457880f24343850252b7..cb44023516c09f15d767a416b2e7ee227109233e 100644 (file)
@@ -398,6 +398,7 @@ public class MenuBar extends Widget implements PopupListener {
             {
                 setWidget(item.getSubMenu());
                 item.getSubMenu().onShow();
+                setOwner(MenuBar.this);
             }
 
             @Override
index 83b1c58d0ae55b3e3db568ac46b0c684635204d0..1837cbc8f415aa7271304fc5ab036e1af6e60ba9 100644 (file)
@@ -559,6 +559,7 @@ public class VMenuBar extends SimpleFocusablePanel implements
         final int shadowSpace = 10;
 
         popup = new VOverlay(true, false, true);
+        popup.setOwner(this);
 
         /*
          * Use parents primary style name if possible and remove the submenu
index 44dfaffd6e4558072d8efe6be6e58cb4e0fde05a..1c456a53b39ff9d59d78e7a7f1b124d67c5512ab 100644 (file)
@@ -424,10 +424,11 @@ public class VNotification extends VOverlay {
 
         final int delay = notification
                 .getIntAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_DELAY);
-        createNotification(delay).show(html, position, style);
+        createNotification(delay, client.getRootConnector().getWidget()).show(
+                html, position, style);
     }
 
-    public static VNotification createNotification(int delayMsec) {
+    public static VNotification createNotification(int delayMsec, Widget owner) {
         final VNotification notification = GWT.create(VNotification.class);
         notification.delayMsec = delayMsec;
         if (BrowserInfo.get().isTouchDevice()) {
@@ -440,6 +441,7 @@ public class VNotification extends VOverlay {
                 }
             }.schedule(notification.delayMsec + TOUCH_DEVICE_IDLE_DELAY);
         }
+        notification.setOwner(owner);
         return notification;
     }
 
index fd1e9e2dbef79bc7fb146657a673ba5fe5ca3e1c..88ee3afadabc7d07631509896bef68354b8990a7 100644 (file)
@@ -204,7 +204,7 @@ public class VPopupView extends HTML {
 
         public CustomPopup() {
             super(true, false, true); // autoHide, not modal, dropshadow
-
+            setOwner(VPopupView.this);
             // Delegate popup keyboard events to the relevant handler. The
             // events do not propagate automatically because the popup is
             // directly attached to the RootPanel.
index 58db8494f006578a79da6b0c2e0e117fa1ab3dd1..ab080dc17f0283a1337f68d8248f45144850735b 100644 (file)
@@ -72,6 +72,9 @@ public class VSlider extends SimpleFocusablePanel implements Field,
 
     private final HTML feedback = new HTML("", false);
     private final VOverlay feedbackPopup = new VOverlay(true, false, true) {
+        {
+            setOwner(VSlider.this);
+        }
 
         @Override
         public void show() {
index 264ed57cedb36073615aab2b7b27e46c20ac6c81..e7bfd4dbdb1e9863810bc3cb0bb4bda3160c1e3e 100644 (file)
@@ -36,7 +36,6 @@ import com.google.gwt.user.client.Element;
 import com.google.gwt.user.client.Event;
 import com.google.gwt.user.client.Window;
 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.client.ApplicationConnection;
 import com.vaadin.client.BrowserInfo;
@@ -433,16 +432,11 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
     private void showModalityCurtain() {
         DOM.setStyleAttribute(getModalityCurtain(), "zIndex",
                 "" + (windowOrder.indexOf(this) + Z_INDEX));
-        if (isShowing()) {
-            RootPanel.getBodyElement().insertBefore(getModalityCurtain(),
-                    getElement());
-        } else {
-            DOM.appendChild(RootPanel.getBodyElement(), getModalityCurtain());
-        }
+        getOverlayContainer().appendChild(getModalityCurtain());
     }
 
     private void hideModalityCurtain() {
-        DOM.removeChild(RootPanel.getBodyElement(), modalityCurtain);
+        modalityCurtain.removeFromParent();
     }
 
     /*
@@ -450,12 +444,13 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
      * iframes (etc) do not steal event.
      */
     private void showDraggingCurtain() {
-        DOM.appendChild(RootPanel.getBodyElement(), getDraggingCurtain());
+        getElement().getParentElement().insertBefore(getDraggingCurtain(),
+                getElement());
     }
 
     private void hideDraggingCurtain() {
         if (draggingCurtain != null) {
-            DOM.removeChild(RootPanel.getBodyElement(), draggingCurtain);
+            draggingCurtain.removeFromParent();
         }
     }
 
@@ -464,12 +459,13 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
      * that iframes (etc) do not steal event.
      */
     private void showResizingCurtain() {
-        DOM.appendChild(RootPanel.getBodyElement(), getResizingCurtain());
+        getElement().getParentElement().insertBefore(getResizingCurtain(),
+                getElement());
     }
 
     private void hideResizingCurtain() {
         if (resizingCurtain != null) {
-            DOM.removeChild(RootPanel.getBodyElement(), resizingCurtain);
+            resizingCurtain.removeFromParent();
         }
     }
 
index b975ab8e88f6b38bd1fad26e3fc10b45117f87b6..3091ab82d0c1f6cd9bb6dcc76f1a56e14ebb4c8d 100644 (file)
@@ -75,6 +75,8 @@ public class WindowConnector extends AbstractComponentContainerConnector
                 getWidget().contentPanel.getElement());
         getLayoutManager().registerDependency(this, getWidget().header);
         getLayoutManager().registerDependency(this, getWidget().footer);
+
+        getWidget().setOwner(getConnection().getRootConnector().getWidget());
     }
 
     @Override
index 7b1a56dc6298b13b7104a324c236f5e7619b1bc4..044c5a18f68746acc77a7e456e7dcfcf0776e27d 100644 (file)
@@ -19,6 +19,7 @@ public class CapsLockWarningConnector extends AbstractExtensionConnector {
         final Widget passwordWidget = ((ComponentConnector) target).getWidget();
 
         final VOverlay warning = new VOverlay();
+        warning.setOwner(passwordWidget);
         warning.add(new HTML("Caps Lock is enabled!"));
 
         passwordWidget.addDomHandler(new KeyPressHandler() {
index fdd14d40d519e3aff3cbfd2a529ef7eb00f2d9ac..b7dead981905aa6d798f659f94244a29bc1fd337 100644 (file)
@@ -23,6 +23,7 @@ public class CapsLockWarningWithRpcConnector extends AbstractExtensionConnector
         final Widget passwordWidget = ((ComponentConnector) target).getWidget();
 
         final VOverlay warning = new VOverlay();
+        warning.setOwner(passwordWidget);
         warning.add(new HTML("Caps Lock is enabled!"));
 
         passwordWidget.addDomHandler(new KeyPressHandler() {