tags:

views:

376

answers:

1

There is this well-known problem that browsers don't put Ajax request in the request history and cause problems for bookmarkability, forward/back button, and refresh.

Also, there is a common solution to that problem that appends the hash symbol # and some additional parameters to the URL by using Javascript window.location.hash = ....

In this question a basic solution to this problem is proposed, for example.

=> My question is if such a solution has been integrated in Wicket, so that existing Wicket facilities are used and no custom Javascript had to be added. If not, I'd be interested in how this could be done.

Such a solution had to answer the question what should be put after the hash.

I like the idea that the bookmarkable URL that (in the non-Ajax case) were in front of the hash could be put behind it. For example, when you are on http://host/catalog and reach a page http://host/product/xyz the Ajax-triggered URL would be
http://host/catalog#/product/xyz.

Then it would be easy to write an onload handler that checks for the # and does a redirect to the URL after the hash.

+1  A: 

As far as I know there is no such solution already integrated into wicket.

To see how this could be done, I do something like this (but still rather primitively) in the ical-aggregator project - the interesting bits are in commit http://repo.or.cz/w/ical-aggregator.git/commit/4cefb01eac230ac5dc776a13a8b751e1c17a4f00 .

If you'd want to cooperate in solving this in a general way as a wicket-stuff project, I'd be interested to help.

Arnout Engelen