You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Denis Burlaka <de...@gmail.com> on 2007/05/25 12:07:08 UTC
T4.1.2 and callback function for JSON response
Hi, All.
I studied the problem how to set callback function on the JSON response and
I found that when JSON response is received no callback function is called.
It happens only if json="true". This happens in the file form.js in
submitAsync:function(form, content, submitName, parms) function. I think it
should look like that:
if (this.forms[formId].json || parms && parms.json) {
kwArgs.headers={"json":true};
kwArgs.mimetype="text/json";
---> kwArgs.load=(function(){tapestry.loadJson.apply (this, arguments);});
} else {
kwArgs.headers={"dojo-ajax-request":true};
kwArgs.mimetype="text/xml";
kwArgs.load=(function(){tapestry.load.apply(this, arguments);});
}
Is it bug?
Or am I wrong?
Thanks.
Re: T4.1.2 and callback function for JSON response
Posted by Jesse Kuhnert <jk...@gmail.com>.
Yep it's definitely a bug. Will try to fix that today:
https://issues.apache.org/jira/browse/TAPESTRY-1517 .
On 5/25/07, Denis Burlaka <de...@gmail.com> wrote:
>
> Hi, All.
>
> I studied the problem how to set callback function on the JSON response
> and
> I found that when JSON response is received no callback function is
> called.
> It happens only if json="true". This happens in the file form.js in
> submitAsync:function(form, content, submitName, parms) function. I think
> it
> should look like that:
>
> if (this.forms[formId].json || parms && parms.json) {
> kwArgs.headers={"json":true};
> kwArgs.mimetype="text/json";
> ---> kwArgs.load=(function(){tapestry.loadJson.apply (this,
> arguments);});
> } else {
> kwArgs.headers={"dojo-ajax-request":true};
> kwArgs.mimetype="text/xml";
> kwArgs.load=(function(){tapestry.load.apply(this, arguments);});
> }
>
> Is it bug?
> Or am I wrong?
>
> Thanks.
>
--
Jesse Kuhnert
Tapestry/Dojo team member/developer
Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com