Tuesday, January 31, 2012

Window.ClosingEvent is not fire in iPad

Hello,

When I make a change of my window location the Window.ClosingEvent
it's not fire on Safari, iPad2, iOS 5.0.1...

I attach a example source that works in android, firefox, chrome...
but not in Safari... I don't know which is the problem... could anyone
help me¿

Thank you

--------------------------------------------------------------------------------------------------------------------------------
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.RootLayoutPanel;

public class Test implements EntryPoint {

public void onModuleLoad() {
Window.addWindowClosingHandler(new Window.ClosingHandler() {
public void onWindowClosing(Window.ClosingEvent closingEvent) {
closingEvent.setMessage("Are you sure?" );
}
});
Button b = new Button("Button");
RootLayoutPanel.get().add(b);
b.addClickHandler(new ClickHandler(){

@Override
public void onClick(ClickEvent event) {
change_location();
}});
}

public static native void change_location()/*-{
$wnd.location.replace('http://www.google.com');
}-*/;
}
--------------------------------------------------------------------------------------------------------------------------------


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment