Have you ever noticed that when your application uses a lot of Ajax features to replace Panels, the user looses the ability to use the back/forward buttons of his browser, or even to bookmark the page?
If there was a lot of Ajax browsing (panel replacements), when the user clicks on the back or the refresh button the browser will take him to the last visited page, or even to his home page.
My goal here was to provide a set of functions allowing the developper to change the token in the URL, but also to add a behavior listening to the token changes.
1. If you call
the new URL will be http://localhost:8080/home#newtoken
1. If you add a DefaultTokenValueChangeAjaxBehavior (requires IE8+) or a JqueryTokenValueChangeAjaxBehavior (requires jquery.js)
you will be notified each time the token changes; for example if the uses presses the back button, or if the TokenManager.changeToken method is called.
You can have a look at the project here : https://github.com/vmontane/wicket-ajax-bookmarks.
There is also a demo project with a simple
How to start the demo in a few command lines : - get the project on github
git clone git://github.com/vmontane/wicket-ajax-bookmarks.git wicket-ajax-bookmarks
- build wicket-ajax-bookmarks
cd wicket-ajax-bookmarks/wicket-ajax-bookmarks mvn install
- build wicket-ajax-bookmarks-example
cd ../wicket-ajax-bookmarks-example mvn install
- run the application with the jetty maven plugin
That's all ! Now you can browse to http://localhost:8080 and start playing with the demo.
Note that this projetct uses some elements of Wicket 1.5 and has not been tested with Wicket 1.6-beta. If you wish to contribute or ask for new requests don't hesitate to contact me.