Creating multi-tab applications

Every new request to the server gets a new session and UI instance. Having the application open in separate tabs or windows means that the instances are totally separate from each others, and thus won’t conflict and cause any out of sync or similar issues.

Opening the new tab will open the application into it’s start page. Use URI fragments if you want to open a specific view into the secondary tab. You can read the URI fragments in the UI.init() and decide if you want to show the main view or a specialized view:

Java

  1. public void init(VaadinRequest request) {
  2. String person = request.getParameter("editPerson");
  3. if (person == null) {
  4. setContent(new MainView());
  5. } else {
  6. setContent(new EditPersonView(person));
  7. }
  8. }

More examples on URI fragments and parameters can be found at: