开发者

How to open new subwindow from another subwindow in vaadin?

开发者 https://www.devze.com 2022-12-22 16:34 出处:网络
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 tr

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 ho开发者_JAVA技巧w to solve this in vaadin.


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.


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.


On Vaadin 7 this can be done as follows:

getUI().addWindow(myNewSubWindow);
0

精彩评论

暂无评论...
验证码 换一张
取 消