如何从 vaadin 中的另一个子窗口打开新的子窗口?

发布于 2024-08-24 08:08:56 字数 168 浏览 5 评论 0原文

我想从另一个子窗口打开一个子窗口。也就是说,我在该窗口中有一个弹出子窗口,我放置了一个按钮。如果我们单击该按钮,则应该打开另一个弹出子窗口。当我尝试此操作时,我收到错误“java.lang.IllegalArgumentException:您只能在应用程序级窗口中添加窗口。”谁能告诉我如何在 vaadin 解决这个问题。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

把回忆走一遍 2024-08-31 08:08:56

您需要引用应用程序的主窗口,并向其添加一个子窗口。

yourCurrentSubWindow.getApplication().getMainWindow().addWindow(myNewSubWindow);

希望这有帮助。

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.

海未深 2024-08-31 08:08:56

只是对先前解决方案的一个小修正:

yourCurrentSubWindow.getApplication().getMainWindow().addWindow(myNewSubWindow);

那些基于 div 的嵌入式子窗口不能包含子窗口,但主窗口(以及任何其他顶级本机窗口)可以。

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.

把时间冻结 2024-08-31 08:08:56

在 Vaadin 7 上,可以按如下方式完成此操作:

getUI().addWindow(myNewSubWindow);

On Vaadin 7 this can be done as follows:

getUI().addWindow(myNewSubWindow);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文