PDA

View Full Version : MessageBox steals popup focus (IE)



egotec
27 Jul 2010, 11:53 PM
Hello.

When I open a info message box and directly before or after that I open a window popup, the window popup comes to the background. Only in IE - it doesn't do this in Firefox.

Here's my code:

MessageBox.info("Test", "Test", null);
Window.open(url, "_blank", params);


Thanks.

sven
28 Jul 2010, 1:34 AM
This is, more a loss, a feature of IE.

You can change MessageBox to not focus any if its button, or you can open the other Window after the MessageBox got the focus.

egotec
28 Jul 2010, 2:21 AM
thanks.

1.


You can change MessageBox to not focus any if its button

How is this possbile, I didn't find anything in the javadoc API.

-- or

2.

you can open the other Window after the MessageBox got the focus.

How must the listener be set?
This doesn't work:

MessageBox m = MessageBox.info("HH", "HH", null);
m.getDialog().getButtonById("ok").addListener(Events.Focus, new Listener<MessageBoxEvent>() {

@Override
public void handleEvent(MessageBoxEvent be) {
Window.alert("blalba");
}});

Colin Alworth
28 Jul 2010, 11:31 AM
MessageBox msg = ...;
Button myBtn = msg.getDialog.getButtonById(Dialog.OK);
msg.getDialog().setFocusWidget(myBtn);