我是GWT和网络新手。popuppanel在小部件下面显示
我想使用弹出/对话工作了我自己的项目。弹出窗口和对话框始终显示在小部件后面。我一直在搜索,最相关的我发现是这 http://groups.google.com/group/gwt-google-apis/browse_thread/thread/40db4fcbe10d2060它不提供任何答案。无论如何,我有第三方库,bst-player 1.3,它使用flash。所以我禁用了它(后来删除它),弹出窗口不会到达顶部!它仍然隐藏在小部件后面。
我了解到popuppanel/dialogpanel有do not need to get added to another widget。一种不同的说法是,它不是一个常规的小部件,它不能附加到父项,但它将自己附加到dom上以保证处于顶端(从GWT composite widget)
我在我的智慧结束和我在这里以SO ...
UPDATE
这里是我的弹出类
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();
}
});
以下是弹出窗口如何在下的小部件。
如果你要downvote或关闭,请解释原因。 – 2012-04-09 15:39:55
可能是因为您应该显示导致问题的代码,而不仅仅是关于项目的一些常规信息。 – Strelok 2012-04-10 01:14:04
我已经在code.google.com中包含了项目,这是我的项目所依据的,并且没有太大的偏差。 – 2012-04-10 01:25:54