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
Windowwidget you have,setWidth,setHeight,centerInPageetc…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()afterShowModalMask()in your case) to avoid this kind of exception.