-
1. Re: Code examples of HTML5 push state use in and Errai 3.1.2
ddadlani May 1, 2015 12:01 PM (in response to hr.stoyanov)Hello Hristo,
You can take a look at Errai's Grocery List demo for pushstate functionality. The push state flag is set in index.html, and you can set custom page paths by using the 'path' parameter in the @Page annotation. For more information you can take a look at Errai Reference Guide - Page State Parameters.
Cheers,
Divya -
2. Re: Code examples of HTML5 push state use in and Errai 3.1.2
hr.stoyanov May 1, 2015 1:59 PM (in response to ddadlani)Divya,
Thanks. I know about page path and page states as described in the docs, but that is not enough. Let me try to explain my issue better:
1. I have an ERRAI web app. In one of the pages I have internal tabs and buttons .
2. As the user clicks on the tabs and buttons, I simply want to manipulate the url and browser history, reflecting
the internal page state. According to the HTML5 History API, this can be done with JS replaceState(...).
3. I do not want to cause Errai switching pages, as this causes pageShowing, etc, which I already use for data loadsMy question is :
1. Should is use JSNI to call replace state?
2. Should I include J. Barops GWT package and use it? I did not see a clear, 5-line example, but if I spend some time digging the sources and test cases I can figure it out.
3. Does Errai offer more elegant API, possibly exposing J. Barop's APIsThanks.l
-
3. Re: Code examples of HTML5 push state use in and Errai 3.1.2
ddadlani May 1, 2015 5:28 PM (in response to hr.stoyanov)Hello Hristo,
There currently isn't a way to manipulate the URL without triggering a page navigation. However, one possible workaround would be to extend PageNavigationErrorHandler with your required functionality, since Errai navigation uses that to deal with any unrecognised URLs entered into the browser's location bar.
You could also submit a feature request at Errai - JBoss Issue Tracker if you feel that this should be explicitly implemented in Errai Navigation.Cheers,
Divya -
4. Re: Code examples of HTML5 push state use in and Errai 3.1.2
hr.stoyanov May 15, 2015 4:19 AM (in response to ddadlani)Divya,
I filed a request for this feature here:
[ERRAI-854] HTML5 pushTSate enhancements - JBoss Issue Tracker
-
5. Re: Code examples of HTML5 push state use in and Errai 3.1.2
ddadlani May 25, 2015 2:58 PM (in response to hr.stoyanov)Hello Hristo,
We took a look at your feature request, but we decided against implementing it as exposing the pushstate API is not the purpose of Errai Navigation. Instead, you can declare your own page path with a custom parameter, and use the parameter to determine the content to display on your page.
You can also use JSNI to change the page state, as you have already mentioned.
Cheers,
Divya