5 Replies Latest reply on May 25, 2015 2:58 PM by ddadlani

    Code examples of HTML5 push state use in and Errai 3.1.2

    hr.stoyanov

      Hi all,

      I need to manipulate the browser URL of an Errai single page application (SPA) without causing  page refresh, so that the browser has correct page state history. From my research, this is exactly what HTML5 push state/history APIs do.

       

      Errai docs imply HTML5 push state is supported in page states via some external GWT library, but I did not see anything on how to directly manipulate it.

       

      Can someone point me to code snippet/example of doing this?  if I construct a HistoryToken, how do I set it in the browser URL, without causing refresh?

      Specifically, I have some internal page tab controls, the state of which I would like to record in the url, possibly using the Errai/GWT equivalent of this JS History API: history.replaceState(...)

       

      Can this be done elegantly without resorting to JSNI or downloading extra GWT modules, straight from Errai?

       

      Thanks.