Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Proper way to move from one window to another

warsame bashir
10 years ago Dec 21, 2011 1:02am
Mathias Clerc
10 years ago Dec 21, 2011 2:20am

In Vaadin applications have only one main window.
When you want to change what is displayed to the user, you actually change the content of the window.

So what you are tying to do should be :

  • Window myWindow = new MyWindow();
  • myWindow.setContent(loginPageContent);
  • application.setMainWindow(myWindow);

And after user logged in :

  • myWindow.setContent(firstPageContent); //your HomeForm for instance

When designing a Vaadin application you don't need to think that the whole page will be replaced every time the user do something (like it is for html), if you want to keep header , footer, menu, ... and just change the actual content, you can do it easily with Vaadin.

You may also want to look at the Navigator7 and appfoundation addons. I don't use them myself but they seem to make all the view change handling easier for quite a lot of things.

warsame bashir
10 years ago Dec 21, 2011 3:43am