Hi,
I'm trying to pass some JSON object as a parameter by an Ajax Action Event to the server.
Without any parameters (null) the event works perfectly and does what its supposed to do.
But when I put some JSON object as "server-parameters" there is not response to the click at all.
This is the definition of the doAjaxAction method in the manual.
onclick="XT.doAjaxAction(event-id, source-element, server-parameters, client-parameters);"
The following line works perfectly
This one doesn't do anything. There is no reaction to that onlick event at allCode:<form name="" action=""> <input id="testEvent" type="button" value="Press" onclick="XT.doAjaxAction('testEventAction', this,);"> <div id="content"></div> </form>
The is the Action HandlerCode:<form name="" action=""> <input id="testEvent" type="button" value="Press" onclick="XT.doAjaxAction('testEventAction', this, {'testparam' : 'TESTVALUE'},null);"> <div id="content"></div> </form>
the servlet.xmlCode:public class TestActionsHandler extends AbstractAjaxHandler { public AjaxResponse testEventAction(AjaxActionEvent event) { // doing here something with the parameter Value via event.getParameters().get("testparam") AppendContentAction action = new AppendContentAction("content", new SimpleText("test")); AjaxResponse response = new AjaxResponseImpl(); response.addAction(action); return response; } }
can anybody tell me why that event doesn't fire when i wanna pass some JSON parameters to the server.Code:<!-- Ajax Interceptor --> <bean id="ajaxInterceptor" class="org.springmodules.xt.ajax.AjaxInterceptor"> <property name="handlerMappings"> <props> <prop key="/preview.*">ajaxTestActionsHandler</prop> </props> </property> </bean> <!-- Ajax Handling --> <bean id="ajaxTestActionsHandler" class="ajax.TestActionsHandler"/>
Thanks in advance
UPDATE:
There is a response. I traced the call and there seams to be a problem within the AjaxInterceptor. Within the initEvent method the JSONObject never returns. The code just stops at the last line of the following snippet. I tried to look into JSON itself but didn't find anything there.
(The paramsString is a valid JSON Object)
ANY contribution is appreciated.Code:private void initEvent(AjaxEvent event, HttpServletRequest request) { String paramsString = request.getParameter(this.jsonParamsParameter); if (paramsString != null) { Map<String, String> parameters = new HashMap<String, String>(); JSONObject json = JSONObject.fromString(paramsString);
Thank you


