Reputation: 5469
I want to open one subwindow from another subwindow.That is, i m having one popup subwindow in that window i placed one button.If we click that button another popup subwindow should open. When i am trying this i m getting error that "java.lang.IllegalArgumentException: You can only add windows inside application-level windows." Can anyone tell me how to solve this in vaadin.
Upvotes: 6
Views: 7663
Reputation: 5089
On Vaadin 7 this can be done as follows:
getUI().addWindow(myNewSubWindow);
Upvotes: 1
Reputation: 935
You need a reference to the main window for the application and add a subwindow to that.
yourCurrentSubWindow.getApplication().getMainWindow().addWindow(myNewSubWindow);
Hope this helps.
Upvotes: 12
Reputation: 416
Just a small correction to the previous solution:
yourCurrentSubWindow.getApplication().getMainWindow().addWindow(myNewSubWindow);
Those div-bases embedded child windows cannot contain sub-windows, but the main window (and any other top level native window) can.
Upvotes: 3