[SOLVED] Touchkit - setMainWindow won't work a second time

Hello all,

I’m evaluating the Touchkit addon, which is really promising to me.
Really good work so far, thanks to the vaadin team.

I’m having a strange behavior, i think there is some bug hiding there, but I would like to have your opinion.
I’m trying to add some login to the voornitologist app. To do so, should be as easy as adding a LoginWindow with some LoginForm inside. Then if login is successful, make a second “setMainWindow” to the real application window.
This is where it’s acting weirdly : when I hit the login button, on the second setMainWindow(realWindow), nothing seems to happen :

  • On iOS it does nothing (I can see in the log that all is going well, but screen does not refresh). If I hit the browser refresh button, I come back to the login form.
  • On Android, same behavior as iOS
  • On my dev PC / Chrome, it does nothing (I can see in the log that all is going well, but screen does not refresh). If I hit the browser refresh button,… hey I’m in ! I can see my application window.

I made a really simple test case, I provide it as an attachment

That’s a pity, without this problem, i would be able to publish my first application, but can’t decently do it without a login :wink:

Best regards
12571.zip (4.46 KB)

The setMainWindow() call only changes what window should be sent to the client when they initialize the application; it does NOT change anything in already opened applications. Try Window.setContent() instead.

Many thanks, it’s working. A noob mistake :wink:

Regards