Tuesday, February 24, 2015

GWT 2.7 Window Close Handle Bug?


Since I upgraded to GWT 2.7 my window close handler has stopped working. Before I submitted a bug report I wanted to see if anybody else was having this issue and to verify that nothing has changed and I was still doing it right. My code is:

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.logical.shared.CloseEvent;
import com.google.gwt.event.logical.shared.CloseHandler;
import com.google.gwt.user.client.Window;

public class MyClass implements EntryPoint {
  public void onModuleLoad() {
  Session session = new Session();


   Window.addWindowClosingHandler(new Window.ClosingHandler() {
    @Override public void onWindowClosing(Window.ClosingEvent event) {

    Window.addCloseHandler(new CloseHandler<Window>() {
    @Override public void onClose(CloseEvent<Window> event) {

I have tried and failed to do the above using JSNI, so bonus points if anybody can give me an example on how to do it that way as a backup. I REALLY need to get this working again because the users never use the logout button and close the browser instead. If I can't resolve the issue soon I'm going to have to downgrade to GWT 2.6.


You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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 http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment