user2548380
user2548380

Reputation: 1

GWT ChildWindow.onClose?

In Javascript, I can do the following:

var child = window.open(URL, "_blank"); child.onclose = myChildCloseHandler();

Is it possible to do that same thing with GWT? The main problem seems to be that Window.open does not return any handle to the child window.

Upvotes: 0

Views: 155

Answers (1)

Thomas Broyer
Thomas Broyer

Reputation: 64561

There are two ways to do it in GWT:

  • use Elemental (elemental.html.Window with addEventListener)
  • use JSNI:

    public native void open(String url) /*-{
      var child = window.open(url, "_blank");
      var that = this;
      child.onclose = $entry(function() {
        [email protected]::myChildCloseHandler()();
      });
    }-*/;
    

See also: https://code.google.com/p/google-web-toolkit/issues/detail?id=7822

Upvotes: 1

Related Questions