Friday, September 14, 2018

Re: addWindowClosingHandler only working in IE

I am thinking the problem is in this below code.
But I have not idea how fix this...





Code is from com.google.gwt.user.client.Window

/**
 * Adds a {@link ResizeEvent} handler.
*
* @param handler the handler
* @return returns the handler registration
*/
public static HandlerRegistration addResizeHandler(ResizeHandler handler) {
maybeInitializeCloseHandlers();
maybeInitializeResizeHandlers();
return addHandler(ResizeEvent.getType(), handler);
}

private static void maybeInitializeCloseHandlers() {
if (GWT.isClient() && !closeHandlersInitialized) {
impl.initWindowCloseHandler();
closeHandlersInitialized = true;
}
} I also add a bunch of Window resize handlers. And in addResizeHandler for some reason maybeInitializeCloseHandlers() is called. Now when adding a closehandler closeHandlerInitialized is true.... And thus the close handler is not added....

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment