Return Data

7 views
Skip to first unread message

canonFodder

unread,
Feb 25, 2008, 3:59:37 PM2/25/08
to mxAjax
Does anyone know of a way to get the return data from the mxAjax.Data
function without using the postFunction parameter.

i.e. function pleaseDoThis(x,y){
params = 'xPassed='+x+',yPassed='+y;
new mxAjax.Data({
parser: new mxAjax.CFArrayToJSKeyValueParser(),
executeOnLoad:true,
paramArgs: new mxAjax.Param(url,{param:params, httpMethod:"get",
cffunction:"functionName"}),

});
structResponse = JSON.parse(response);
passedBackVariable = structResponse.returnFromCFC
return passedBackVariable;
}

it is the response that I just can't seem to work out what it is or
how to get it

Thanks

James Holmes

unread,
Feb 25, 2008, 5:14:06 PM2/25/08
to mxa...@googlegroups.com
How do you expect the response variable to be populated without a
callback function to do the job?

--
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/

Arjun....@gmail.com

unread,
Feb 25, 2008, 5:53:29 PM2/25/08
to mxAjax
Data returned by Ajax is in asynchronous manner and thats why you need
to use a callback function that gets executed once the data has been
returned!

Can you explain the rational as to why you dont want to create
postFunction ???


If you dont want to create a separate postfunction here is another
trick

function pleaseDoThis(x,y){
params = 'xPassed='+x+',yPassed='+y;
new mxAjax.Data({
parser: new mxAjax.CFArrayToJSKeyValueParser(),
executeOnLoad:true,
paramArgs: new mxAjax.Param(url,{param:params,
httpMethod:"get",
cffunction:"functionName"}),
postFunction: function(response) {
structResponse = JSON.parse(response);
passedBackVariable =
structResponse.returnFromCFC
return passedBackVariable;
}

});

}


Thanks
Arjun

canonFodder

unread,
Feb 25, 2008, 5:59:09 PM2/25/08
to mxAjax
I obviously don't know enough about JS.

I'm trying to implement something that someone else has designed and
partly coded that uses JQuery Inside their JS code I can insert into
the db by calling the ajax function.I wanted something back from the
cfc, but by using the postFunctions that is completely ignored.

Thanks for you help.
Reply all
Reply to author
Forward
0 new messages