PDA

View Full Version : Window.setModal(true) problem



mmm
1 Oct 2008, 1:01 AM
Hi everybody!

I have some problems with modal mode using Window. When I put something like this:

Window window = new Window();
window.setModal(true);
window.show();somewhere in my application and try resizing browser window, size of the modal panel doesn't change so that some parts of application are uncovered by modal. I have debugged it and noticed that in onRender() method of ModalPanel is below code executing:


int width = body.dom.getScrollWidth();
int height = body.dom.getScrollHeight();
Size vp = XDOM.getViewportSize();

String w = "100%";
String h = "100%";
if (width > vp.width) { // == true
w = width + "px";
}
if (height > vp.height) { // == true
h = height + "px";
}
el().setSize(w, h);So modalPanel size is set to a fixed value. I think here is my problem. I don't really understand what for there are this two "if" statements which cause that modalPanel doesn't change its size during window resizing.

Can anybody help me?

gslender
1 Oct 2008, 1:08 AM
few things here...

1) onRender is only executed once and not normally on resize unless you call layout

2) windows don't auto resize/reposition on browser resize

3) I think you mean the mask is being uncovered, if so put everything in a viewport and this should fix the problem.

mmm
1 Oct 2008, 1:17 AM
3) I think you mean the mask is being uncovered, if so put everything in a viewport and this should fix the problem.

Yes, I mean the mask is being uncovered.

But how can I understand "put EVERYTHING in a viewport"? Main panel of my application /containing all components/ is put in a viewport and problem still exists :/