From dc5a17060e5c91f6e11a86caea41edd2d6b67508 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Wed, 28 Oct 2009 15:05:13 +0000 Subject: [PATCH] merged [9432] from 6.1 svn changeset:9434/svn branch:6.2 --- src/com/vaadin/terminal/gwt/client/ui/VView.java | 16 +++++++++++++--- src/com/vaadin/ui/Window.java | 8 ++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VView.java b/src/com/vaadin/terminal/gwt/client/ui/VView.java index 422583cb19..35b411ff1b 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VView.java @@ -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; } diff --git a/src/com/vaadin/ui/Window.java b/src/com/vaadin/ui/Window.java index 828f98fc33..dc1bf7e18f 100644 --- a/src/com/vaadin/ui/Window.java +++ b/src/com/vaadin/ui/Window.java @@ -601,6 +601,14 @@ public class Window extends Panel implements URIHandler, ParameterHandler { * null window name results the resource to be opened in this * window. * + *

+ * 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 -- 2.39.5