gpt4 book ai didi

java - GWT : Showing alert message on top, 与其他警报无关

转载 作者:行者123 更新时间:2023-11-28 18:11:16 25 4
gpt4 key购买 nike

考虑以下情况。

我的应用程序中有 3 个对话框。

final DialogBox alert1 = new DialogBox();
final DialogBox alert2 = new DialogBox();
final DialogBox alert3 = new DialogBox();

然后我打电话来显示这些对话框

alert1.show();
alert2.show();
alert3.show();

这是我的问题:

无论调用 show() 函数的顺序如何,我总是希望在顶部显示 alert2。目前 alert1 显示在顶部,alert 2 在中间,alert3 在后面。

在这里使用三个对话框快速查找问题。


enter image description here

尝试用很少的 Css 知识为 alert2 设置 Z-index

DOM.setIntStyleAttribute(alert.getElement(), "zIndex", 101);

仍然知道效果。它显示在同一个地方并且无法点击 alert2 上的链接

感谢任何提示。

最佳答案

问题似乎出在 DialogBox 的模态功能上(继承自它扩展的 PopupPanel)。默认情况下,它会阻止未包含在对话框中的小部件的鼠标和键盘事件。因此,因为 alert3 是最后显示的,所以它会禁用 alert2 事件。

如果您想要禁用模态属性的对话框,请将模态设置为 false:

 alert1.setModal(false);

或者调用这个构造函数:

 final DialogBox alert1 = new DialogBox(true, false);

关于java - GWT : Showing alert message on top, 与其他警报无关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18566938/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com