diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2013-11-07 19:55:32 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-11-08 13:59:22 +0000 |
commit | 0a2cf2c429fca3be697dcf37d386a4607d4bdbc3 (patch) | |
tree | 4283d96f93155dbe377a526956a47c883e7ea343 | |
parent | 30e9b7c7940e617d5ed9ed5bf883a460a8ec0e98 (diff) | |
download | vaadin-framework-0a2cf2c429fca3be697dcf37d386a4607d4bdbc3.tar.gz vaadin-framework-0a2cf2c429fca3be697dcf37d386a4607d4bdbc3.zip |
Prevent showing "Session Expired" notification if navigating away (#12298)
Currently only works if navigation initiated via Page.open(url, "_self").
Page.setLocation should be changed in 7.2 to use "_self" as well (#12925)
Change-Id: I56ad66ffbbd1a83b64999307d23028cbd84bb508
-rw-r--r-- | client/src/com/vaadin/client/ui/VUI.java | 3 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/ui/UIConnector.java | 22 |
2 files changed, 12 insertions, 13 deletions
diff --git a/client/src/com/vaadin/client/ui/VUI.java b/client/src/com/vaadin/client/ui/VUI.java index 4817bf9304..ba3495743d 100644 --- a/client/src/com/vaadin/client/ui/VUI.java +++ b/client/src/com/vaadin/client/ui/VUI.java @@ -101,9 +101,6 @@ public class VUI extends SimplePanel implements ResizeHandler, private int parentHeight; /** For internal use only. May be removed or replaced in the future. */ - public boolean rendering; - - /** For internal use only. May be removed or replaced in the future. */ public boolean immediate; /** For internal use only. May be removed or replaced in the future. */ diff --git a/client/src/com/vaadin/client/ui/ui/UIConnector.java b/client/src/com/vaadin/client/ui/ui/UIConnector.java index 8813d70609..149d99de17 100644 --- a/client/src/com/vaadin/client/ui/ui/UIConnector.java +++ b/client/src/com/vaadin/client/ui/ui/UIConnector.java @@ -130,11 +130,16 @@ public class UIConnector extends AbstractSingleComponentContainerConnector Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { - if (sessionExpired) { - getConnection().showSessionExpiredError(null); - } else { - getState().enabled = false; - updateEnabledState(getState().enabled); + // Only notify user if we're still running and not eg. + // navigating away (#12298) + if (getConnection().isApplicationRunning()) { + if (sessionExpired) { + getConnection().showSessionExpiredError(null); + } else { + getState().enabled = false; + updateEnabledState(getState().enabled); + } + getConnection().setApplicationRunning(false); } } }); @@ -192,7 +197,6 @@ public class UIConnector extends AbstractSingleComponentContainerConnector @Override public void updateFromUIDL(final UIDL uidl, ApplicationConnection client) { ConnectorMap paintableMap = ConnectorMap.get(getConnection()); - getWidget().rendering = true; getWidget().id = getConnectorId(); boolean firstPaint = getWidget().connection == null; getWidget().connection = client; @@ -285,9 +289,8 @@ public class UIConnector extends AbstractSingleComponentContainerConnector childIndex++; } if (isClosed) { - // don't render the content, something else will be opened to this - // browser view - getWidget().rendering = false; + // We're navigating away, so stop the application. + client.setApplicationRunning(false); return; } @@ -397,7 +400,6 @@ public class UIConnector extends AbstractSingleComponentContainerConnector } }); } - getWidget().rendering = false; } /** |