Hi,

I guess you know that History API (pushState) works only in IE10, all older
versions of IE do not support it.

About your question: you can use AjaxRequestTarget#addChildren(getPage(),
AbstractLink.class) to add all links in the current page to be repainted.
Wicket uses getRequestCycle().getUrlRenderer().getBaseUrl() as a base to
calculate the relative urls, so you can set it in your #onXyz() callback
methods.

Using absolute url may break when you are behind a reverse proxy. This is
the reason why Wicket produces relative urls. If this is not a problem for
you then you can override RequestCycle#newUrlRenderer() to return a
renderer that always uses #renderFullUrl() when #renderUrl() is called.


On Mon, May 27, 2013 at 4:34 AM, Colin Rogers <
[email protected]> wrote:

> Wicketeers,
>
> I have an odd issue - that isn't really a bug or a coding problem - but
> something I thought people might have some ideas on.
>
> A little background first. I like to have URLs in my application, as per
> the examples below;
>
> player
> player/messages
> player/messages/archive
> player/messages/old
> something
> something/another/thing/or/whatever
>
> etc.
>
> Now - I'm trying to implement 'panel switching' (I honestly have no idea
> what this is called...) - where I only replace the parts of the page that
> actually need replacing, rather than recreating all elements of the page
> and re-rendering them.
>
> This is, unsurprisingly, very easy with Wicket. It's easy to determine
> what needs replacing, and to actually replace them, via ajax. All good!
>
> I also want the user to be able to 'refresh' the page and/or bookmark the
> page and have the page recreate itself from scratch. Again - this is pretty
> easy, using javascript and history.pushState etc.
>
> The problem I have is when some of my Links are relative to the URL. So
> where I had a link that was relative to X/Y, when I push the URL to be
> X/Y/Z, all the relative links are out of date.
>
> I guess the questions are; how can I make all Links absolute rather than
> relative? And, is there any way of doing this across the application? Are
> there other issues that could affect what I'm trying to do?
>
> I realise I can just make all my URLs one level deep - so that all
> relative links work;
>
> player
> playerMessages
> playerMessagesArchive
>
> But it's simply not as pretty! :)
>
> Cheers,
> Col.
> EMAIL DISCLAIMER This email message and its attachments are confidential
> and may also contain copyright or privileged material. If you are not the
> intended recipient, you may not forward the email or disclose or use the
> information contained in it. If you have received this email message in
> error, please advise the sender immediately by replying to this email and
> delete the message and any associated attachments. Any views, opinions,
> conclusions, advice or statements expressed in this email message are those
> of the individual sender and should not be relied upon as the considered
> view, opinion, conclusions, advice or statement of this company except
> where the sender expressly, and with authority, states them to be the
> considered view, opinion, conclusions, advice or statement of this company.
> Every care is taken but we recommend that you scan any attachments for
> viruses.
>

Reply via email to