Navigator without uri fragment

I am just starting the migration from Vaadin 6 to 7, and I love the idea of navigator to switch between the three main views of my application. All of the examples/tutorials I’ve seen explain it’s usage with urifragments, however, I actually don’t want the url to reflect three separate views (allowing use of the back button and bookmarking). Is there a way to use navigator strictly as a simple view manager?

First off, I don’t recommend it. But yes, it should be possible (although untested). You can write your own NavigationStateManager that simply stores the state in a member variable, then pass an instance to the Navigator constructor that takes a NSM.

Ok, much appreciated, Johannes.

Any example using NavigationStateManager ??

Thanks

I ended up accomplishing this by registering the views in MyUI class as normal, then (say after successful login), you can switch to a new view with

MyUI.getCurrent().getNavigator().getDisplay().showView(new MainView());

Weell, then you practically don’t use or need the Navigator at all. You can just as well simply say MyUI.setContent(new MainView()); and save a lot of typing :stuck_out_tongue:

Yes, ok, that’s true. Although, I have the navigator registered to a piece of the main UI page (minus the header, et al). So, the navigator is just switching out the main content, between three views. May still be overkill, but it works fine for the moment. Thank you for the response!