im facing a randomly appearing IllegalStateException and have no clue how i could get rid of it.
I tried so many times to reproduce it, but it just appears randomly.
this is the Code i have
@Override
public void init() {
this.setMainWindow(this.createNewWindow());
}
@Override
public Window getWindow(final String name) {
return Navigator.getWindow(this, name, super.getWindow(name));
}
@Override
public Window createNewWindow() {
this.setTheme("...");
final Window mainWindow = new Window(NAME);
mainWindow.setImmediate(true);
mainWindow.addParameterHandler(new AutoLoginParameterHandler(this));
this.setMainWindow(mainWindow);
...
return mainWindow;
}
and the mentioned Exception message
its my first post here, i hope i provided you with all the necessary information you need, if not just dont hesitate to ask for more.
I see at least one problem in your code, you are calling this.setMainWindow(mainWindow) in the createNewWindow() method. You should only call setMainWindow in the init() method of Application (like you do) so you I’d say you should remove that line from createNewWindow(). That’s probably the cause of the exception too.
I haven’t written here yet because I needed some time to see if the problem would disappear, which seems to be the case now, however another problem has returned.
Now i have the Problem that my LoginWindow doesnt react to the ENTER Button again, the event doesnt get fired when I press the Enter Button but it works when I press the Button per MouseClick and I can login.
The ShortCut worked well until I removed the line you mentioned. The reason why I had set the MainWindow in the createWindow was because of the ShortCut. I was googleing again to find a solution for the ShortCut bug without setting the mainWindow and I finally found this
Thread with exactly the same problem.
I´d be happy if you have any solutions or ideas for me to fix this issue.
My Vaadin version was 6.6.7 and is updated to 6.7.0 now.