IllegalStateException randomly appearing

Hi people,

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

 public void init() {
 public Window getWindow(final String name) {
  return Navigator.getWindow(this, name, super.getWindow(name));
 public Window createNewWindow() {
  final Window mainWindow = new Window(NAME);
  mainWindow.addParameterHandler(new AutoLoginParameterHandler(this));
  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.

Regards kaya

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.

Hi Henri,

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
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.


EDIT: updated to 6.7.1 now


no ideas?

Try this for a workaround. Call main window’s addWindow() for your sub-window before you set component’s shortcut listener by setClickShortcut().

Did some digging and the reason for this is that AbstractField.setClickShortcut() needs ref to a Window which is not yet present.

Hi guys,

the bug has been fixed with Vaadin 6.7.4, thanks to Vaadin team.

· #7567: Button: setClickShortcut NOT WORKING PROPERLY