1

I'm developing a project under Wicket 1.5 which uses jQuery.

I've been using Wicket 1.4 before, and I'm used to call Wicket Java code from JavaScript with

function callWicket() {
   var wcall = wicketAjaxGet('$url$' + '$args$', function() { }, function() { });
}

As seen in Calling Wicket from Javascript. It works fine under Wicket 1.4.

But when I do this on Wicket 1.5, I receive this response,

<ajax-response>
  <redirect>?0</redirect>
</ajax-response>

which redirects to the page and destroys the Ajax flow..

(I've seen Javascript in Wicket 1.5, but my question is the other side of the behaviour...)

I'm using this to control hashtag (#tag) history in browers, in conjunction with jQuery and jQuery history. Alternatively, is there another method to control hashtag with Wicket 1.5 ?

thanks!!

0

1 Answer 1

2

The same code should work in 1.5. It seems you do something in your onAjaxCallback() that makes Wicket do the redirect, e.g. something like setResponsePage(AnotherPage.class). To manage the hash tag you can use target.appendJavaScript("localtion.hash='#anything'"). With JQuery History you can listen to hashchange event (and since recently to popchange event) and depending on the hash value do Wicket Ajax calls with different URL and/or parameters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.