Beginner : set main window


In my first Vaadin application init, I have setMainWindow(new LoginWindow())

In my loginWindow, after login, I have getApplication().setMainWindow(new MainWindow)

The problem is that MainWindow is not displayed and LoginWindow stays. Did I forgot something ?

Thank you.

There has been a bug that prevents changing the main window on the fly (i.e. without a browser refresh) but I’m not sure is it fixed already or not.

In any case, the workaround is to just change the contenst (i.e. layout) of the main window, not the whole window itself.


mainWindow.setContent(new MainView());

Actually - thid bug applies only to LoginForm and its onLogin event:

Thank you very much ! All is ok with only one window and 2 layouts.

I use LoginForm.

Hm, at least saw this effect on one of our developer - setMainWindow did not work until manual refresh in a browser, so I suggested him to do explicit window reopening by a new main window URL. Will check tomorrow if he did use latest Vaadin - probably it is not.