]> source.dussan.org Git - vaadin-framework.git/commitdiff
merged [9432] from 6.1
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 28 Oct 2009 15:05:13 +0000 (15:05 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 28 Oct 2009 15:05:13 +0000 (15:05 +0000)
svn changeset:9434/svn branch:6.2

src/com/vaadin/terminal/gwt/client/ui/VView.java
src/com/vaadin/ui/Window.java

index 422583cb19b6e0985311b25624677e62a764dc0b..35b411ff1bf6d79467a0a45e7f0218445399fc38 100644 (file)
@@ -183,8 +183,17 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
             final String url = open.getStringAttribute("src");
             final String target = open.getStringAttribute("name");
             if (target == null) {
-                // This window is closing. Nothing was done in the close event,
-                // so don't need to call it before going to the new url
+                // source will be opened to this browser window, but we may have
+                // to finish rendering this window in case this is a download
+                // (and window stays open).
+                DeferredCommand.addCommand(new Command() {
+                    public void execute() {
+                        goTo(url);
+                    }
+                });
+            } else if ("_self".equals(target)) {
+                // This window is closing (for sure). Only other opens are
+                // relevant in this change. See #3558, #2144
                 isClosed = true;
                 goTo(url);
             } else {
@@ -214,7 +223,8 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
             childIndex++;
         }
         if (isClosed) {
-            // don't render the content
+            // don't render the content, something else will be opened to this
+            // browser view
             rendering = false;
             return;
         }
index 828f98fc33e05aa6bc771111e9996f80a12dd445..dc1bf7e18fe094fcb3b84b47c32c01abe6ceca8a 100644 (file)
@@ -601,6 +601,14 @@ public class Window extends Panel implements URIHandler, ParameterHandler {
      * <code>null</code> window name results the resource to be opened in this
      * window.
      * 
+     * <p>
+     * Note! When opening browser window with name "_self", client will skip
+     * rendering rest of the changes as it considers them irrelevant. This may
+     * speed up opening resource, but it may also put client side into an
+     * inconsistent state with server in case nothing is actually opened to
+     * window (like if browser decided to download the resource instead of
+     * displaying it).
+     * 
      * @param resource
      *            the resource.
      * @param windowName