PDA

View Full Version : Strange behaviour with modal windows and viewport



throttle
20 Oct 2008, 5:51 AM
I'm writing an application with GXT 1.1.1 libraries and i need to open some modal windows, but i'm obtaining different behaviours in Firefox 3.0 and IE 7 (dunno if it's a bug of some kind).
I've got a viewport with the main application and i want to open a modal window then i want to be able to open another modal window from the last one.
I've been able to recreate the behaviour i'm experiencing with this sample application

package Test.client;

import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.Window;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

public class ModalTest extends LayoutContainer implements EntryPoint {

public void onModuleLoad() {
Viewport view = new Viewport();
Button but = new Button( "press me!", new ButtonListener() );
view.add( but );
RootPanel.get().add( view );
}

class ModalWindow extends Window {

public ModalWindow() {
super();
setModal( true );
Button but = new Button( "press me!", new ButtonListener() );
add( but );
show();
}
}

class ButtonListener extends SelectionListener {

public void componentSelected( ComponentEvent ce ) {

}

public void handleEvent( BaseEvent be ) {
new ModalWindow();
}

}
}In Firefox 3 - and in hosted mode - the windows aren't modal vs the viewport (i.e. i'm able to press the button on the main page), while in IE 7 this is working fine. However in both the browsers the child windows aren't modal vs the other windows (i.e. i can close/resize/press the other windows).
What's wrong in my code?

Thanks in advance

gslender
20 Oct 2008, 1:30 PM
make sure your doctype is correct - html4 quirks mode

throttle
21 Oct 2008, 12:44 AM
Thanks for your answer :)
In my html i have

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">Are you able to replicate the behaviour or there is something else that may be wrong?

gslender
21 Oct 2008, 1:31 AM
I tried your test app and it works fine for me in IE7 and FF3 in Windows XP using gxt 1.1.1

I'd continue to confirm that your CSS and/or HTML is correct - can't replicate so I can't suggest what is wrong.

cheers,
grant