如何在 GWT 的 TabPanel 中使用对话框
我使用 GWT TabPanel
并希望在这些选项卡之一中使用 DialogBox
。我认为 DialogBox
已添加到 RootPanel
中,因为我在每个选项卡中都看到了该框。 是否有一个选项可以仅在创建面板的框中查看该框?或者我必须创建自己的对话框或覆盖一些方法(.show
?)
Greetz, 命运
i use the GWT TabPanel
and want to use a DialogBox
in one of these tabs. I think the DialogBox
is added to the RootPanel
because i see the box in every Tab.
Is there a option to see the box only in the box there the panel was created? Or must i create my own DialogBox or overwrite some methods (.show
?)
Greetz,
Destiny
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
DialogBox
是一个弹出窗口,不附加到任何面板。因此,您不能在TabPanel
中使用Dialogox
in,因为它不会像您那样附加到该面板你自己发现了(它附加到RootPanel
)。如果您只想在选择特定选项卡时显示此对话框,则需要在选择另一个选项卡时隐藏该对话框。您可以通过在 TabPanel 上添加TabListener
并实现onBeforeTabSelected
方法来实现此目的,并检查选择了哪个选项卡并隐藏或显示对话框。A
DialogBox
is is a popup and not attached to any of your panels. So you can't use aDialogox
in aTabPanel
as it will not be attached to that panel as you found out yourself (it's attached to theRootPanel
). If you want to only show this dialogbox when a specific tab is selected you need to hide the dialog box when another tab is selected. You can do this by adding aTabListener
on the TabPanel and implement theonBeforeTabSelected
method and check which tab is selected and hide or show the dialogbox.