I have the following function in java script page that call wicket ajax:
function callWicketPage() {
wicketAjaxGet(
urlCallback,
function() {alert('success'); },
function() { alert('failed');
});
}
and in the wicket page I do the following:
final AbstractDefaultAjaxBehavior behave = new AbstractDefaultAjaxBehavior() {
@Override
public void renderHead(IHeaderResponse ihr) {
super.renderHead(ihr);
ihr.renderJavascript("var urlCallback = '" + this.getCallbackUrl() + "';", "insertedjavascript");
}
protected void respond(final AjaxRequestTarget target) {
}
};
add(behave);
What i want is to send back a json response from the wicket page to JavaScript, How could i do it \?