SmartGWT模态窗口 [英] SmartGWT modal window

查看:109
本文介绍了SmartGWT模态窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有模态窗口的问题。我将这两个方法称为 setIsModal(true) setShowModalMask(true)但为什么我的窗口不是模态? / b>

以下是代码:

 窗口summaryWindow = new Window() ; 
summaryWindow.setWidth(950);
summaryWindow.setHeight(620);
summaryWindow.centerInPage();
summaryWindow.setCanDragReposition(false);
summaryWindow.setIsModal(true);
summaryWindow.setShowModalMask(true);
summaryWindow.setShowMinimizeButton(false);
summaryWindow.setTitle(Example);
summaryWindow.addItem(new Button(Example);
summaryWindow.show();


code> Window 小部件, setWidth setHeight centerInPage etc ...

现在必须应用这些属性中的某些属性,然后才将小部件呈现在浏览器&它们中的一些必须在小部件呈现在浏览器的DOM中之后应用。



ShowModalMask()是一个属性,您可以在渲染窗口小部件之前设置。
centerInPage()是一个在浏览器& DOM中呈现Window的属性,
$ b

之后以正确顺序应用属性( centerInPage()), ShowModalMask()在你的情况),以避免这种例外。


I have problem with modal window. I call this two methods setIsModal(true) and setShowModalMask(true) but why my window isn't modal ?

Here is the Code :

Window summaryWindow = new Window();
summaryWindow.setWidth(950);
summaryWindow.setHeight(620);
summaryWindow.centerInPage();
summaryWindow.setCanDragReposition(false);
summaryWindow.setIsModal(true);
summaryWindow.setShowModalMask(true);
summaryWindow.setShowMinimizeButton(false);
summaryWindow.setTitle("Example");
summaryWindow.addItem(new Button("Example");
summaryWindow.show();

解决方案

The exception you're getting is valid. In any GWT related technology, you'll find many API functionalities to set properties of GWT widget. For example, for a Window widget you have, setWidth, setHeight, centerInPage etc...

Now some of these properties MUST be applied before the widget is rendered in DOM of the browser & some of them MUST be applied after the widget is rendered in DOM of the browser.

ShowModalMask() is a property that you can set only before the widget is rendered. centerInPage() is a property that renders Window in DOM of browser & that is the reason you're getting the exception.

Apply properties in a proper order (centerInPage() after ShowModalMask() in your case) to avoid this kind of exception.

这篇关于SmartGWT模态窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆