gpt4 book ai didi

gwt - 弹出面板显示在小部件下方

转载 作者:行者123 更新时间:2023-12-04 05:50:51 26 4
gpt4 key购买 nike

我是 GWT 和网络方面的新手。

我正在制定我自己的项目
http://code.google.com/p/cloud-tasks-io/source/browse/#svn%2Ftrunk%2FCloudTasks-AppEngine%2Fsrc%2Fcom%2Fcloudtasks%2Fclient

我正在尝试使用弹出窗口/对话框。弹出窗口和对话框始终显示在小部件后面。我一直在谷歌搜索,我发现最相关的是这个
http://groups.google.com/group/gwt-google-apis/browse_thread/thread/40db4fcbe10d2060这不提供任何答案。无论如何,我有第 3 方库 bst-player 1.3,它使用 Flash。所以我禁用了它(后来也删除了它),弹出窗口不会出现在顶部!它仍然隐藏在小部件后面。

我了解到 popuppanel/dialogpanel 很相似 do not need to get added to another widget .一种不同的说法是,从某种意义上说,它不是一个普通的小部件,它不能附加到父级,而是将自己附加到 dom 以保证在顶部(来自 GWT composite widget)

我在我的智慧尽头,我在这里......

更新

这是我的弹出类

public class PopUp {
static PopupPanel simplePopup;

public static void init() {
simplePopup = new PopupPanel(true);
simplePopup.hide();
simplePopup.setVisible(false);

// DOM.setIntStyleAttribute(simplePopup.getElement(), "zIndex", 3);
}

public static void showpopupmsg(String msg, int left, int top) {
if (simplePopup == null) {
init();
}
if (msg != null && !msg.equalsIgnoreCase("")) {
simplePopup.ensureDebugId("cwBasicPopup-simplePopup");
simplePopup.setWidget(new HTML(msg));
simplePopup.setVisible(true);
simplePopup.setPopupPosition(left, top);
simplePopup.setWidth("475px"); //575
simplePopup.setGlassEnabled(true);
simplePopup.show();
}
}

public static void show(String message){
if (simplePopup == null) {
init();
}
simplePopup.setGlassEnabled(true);
simplePopup.setTitle(message);
simplePopup.center();
}
}

这是我打电话的方式
tasksTable.doneColumn.setFieldUpdater(new FieldUpdater<TaskProxy, Boolean>() {
public void update(int index, TaskProxy task, Boolean value) {

String msg = "Here is the popup. All the way underneath";
Widget source = tasksTable;
int left = source.getAbsoluteLeft() - 50;
// source.getAbsoluteLeft() + 25;
int top = source.getAbsoluteTop() - 25;
PopUp.showpopupmsg(msg, left, top); //Here is the calling method

TaskRequest request = requestFactory.taskRequest();
TaskProxy updatedTask = request.edit(task);
updatedTask.setDone(value);
request.updateTask(updatedTask).fire();

}
});

这是弹出窗口的方式 下方 小部件。
enter image description here

最佳答案

问题的根源一直难以捉摸,因为我还是 webapp 的新手,但是,我终于自己解决了。罪魁祸首是 CSS。它将整个事物的 z-index 定义为非常高,如以下代码行 1333 所示。

http://code.google.com/p/cloud-tasks-io/source/browse/trunk/CloudTasks-AppEngine/war/CloudTasks.css#1333

我之前曾怀疑过 z-index 并尝试使用微不足道的值 3,如相关 Popup 类的注释掉代码段中所示。我必须取消注释并将其设置为 101。

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

我是,你知道,#$%#@#$*。

关于gwt - 弹出面板显示在小部件下方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10068633/

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