From: apolds Date: Wed, 24 May 2017 05:34:28 +0000 (+0200) Subject: Allow changing NavigationStateManager (#9416) X-Git-Tag: 7.7.10~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d00deb0f545bf3f6ee1a0b69899569b8da13567e;p=vaadin-framework.git Allow changing NavigationStateManager (#9416) Unregister old NavigationStateManager before setting new one (backport of #9410). Fixes #9406 --- diff --git a/server/src/main/java/com/vaadin/navigator/Navigator.java b/server/src/main/java/com/vaadin/navigator/Navigator.java index 15936f6168..172ab39928 100644 --- a/server/src/main/java/com/vaadin/navigator/Navigator.java +++ b/server/src/main/java/com/vaadin/navigator/Navigator.java @@ -513,6 +513,10 @@ public class Navigator implements Serializable { if (stateManager == null) { stateManager = new UriFragmentManager(ui.getPage()); } + if (stateManager != null && this.stateManager != null + && stateManager != this.stateManager) { + this.stateManager.setNavigator(null); + } this.stateManager = stateManager; this.stateManager.setNavigator(this); this.display = display;