Thursday, October 15, 2020

Re: GWT history with push state

As Tomas said, not directly with History.  It's simple JSNI though:

public static native void updateURL(String newUrl) /*-{
    $wnd.history.pushState(newUrl, "", newUrl);
}-*/;

public static native void initialise() /*-{
$wnd.onpopstate = $entry(function(e) {
@com.blah.YourClass::yourMethodThatListensForUrlChange()();
});
}-*/;

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/b0daf82c-3510-4e12-b404-87bf723b024bn%40googlegroups.com.

No comments:

Post a Comment