Using Navigator for creating bookmarkable applications with back-forward button support
Vaadin 7 has introduced a new capability for easy creation of bookmarkable applications with back and forward button support: the Navigator.
We will see how to use the Navigator
class and what is needed to get it working. Navigator
works with views, layouts that implement the View
interface.
We are going to make an application with two views. We will be able to navigate between these two views with the back and forward buttons or make a bookmark.
The first view will be the welcome view, which we map to an empty URL fragment, so it becomes accessible at http://localhost:8080 address
.
When a user clicks on the Open new Orders button, the orders view is displayed with the orders URL fragment.
How to do it...
Carry out the following steps to learn how to work with Views
in Vaadin 7:
Create a new Vaadin project with the main UI class called, for example,
MyVaadinUI
.Create the welcome view that will show a flattering...