I have used the jQuery AJax call to send JSON as documented here in StackOverflow
The problem is that I am not receiving any Data on the server . I can see that the
Another possible solution in wicket 6 and (maybe in wicket 5 if you use wicketAjaxPost instead of Wicket.Ajax.Post), would be to use the Wicket Ajax browser javascript library that way you can use the standard requestCycle.getRequest().getParameterMap() calls in your behavior.
You can find information about this here:
https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax
For example instead of:
console.log(" call back url :"+ callBackURL);
$.ajax({
url: callBackURL,
type: 'post',
cache: false,
data:JSON.stringify(ccbArry[0]),
contentType: 'application/json',
dataType: 'json',
complete: function() {
alert(" completed okey dokey!")
}
});
You could use:
var success = function() {alert('success!!!')};
var failure = function() {alert('failure:-(')};
// ${callbackUrl} is put in through interpolation in the renderHead of the AbstractAjaxBehavior
// TextTemplate interpolater = new PackageTextTemplate(ContentTools.class, "PackageInit.js");
// Map variables = new HashMap();
// variables.put("callbackUrl", getCallbackUrl());
// interpolater.interpolate(variables);
var callbackUrl = '${callbackUrl}';
var dataMap = {'name' : 'Mr Blogs', 'description' : 'a long description'};
Wicket.Ajax.post({'u': callbackUrl,
'ep': dataMap,
'sh': [success],
'fh': [failure]
});