Calling another Ajax function from postFunction

23 views
Skip to first unread message

arun

unread,
Sep 9, 2009, 9:12:16 PM9/9/09
to mxAjax
Hi All,

I am very new to Ajax and javascript.
Please help me out in this

I have a mxAutoComplete which is working very well. Once it calls the
postFunction , i want another Ajax call from there.

For example , my Autocomplete function - Here i am calling a function
called Check Matinee in postFunction.

function init() {

new mxAjax.Autocomplete({
indicator: "indicator1",
minimumCharacters: "1",
target: "cmpSFilmCode",
className: "autocomplete",
paramArgs: new mxAjax.Param(url,{param:"q=
{srchCode}",httpMethod:"post",cffunction:"getStateList"}),
parser: new mxAjax.CFQueryToJSKeyValueParser(),
source: "cmpSFilmSrch",
postFunction: function() {
checkMat();
},

});
}


CheckMat function


function checkMat()
{
alert("Mat Working");
new mxAjax.Data({
parser: new mxAjax.CFArrayToJSKeyValueParser(),
executeOnLoad:true,
paramArgs: new mxAjax.Param(url,{param:"id=1",
cffunction:"getContent"}),
postFunction: function(response) {
structResponse = JSON.parse(response);
//return passedBackVariable;
}


});
}


But it doesnt seems to be working. Ajax calls are not working within
checkMat function. Please help me how to go move forward in this
issue. The alert command is working and only the Ajax calls are not
working. Please help.

James Holmes

unread,
Sep 10, 2009, 9:52:44 PM9/10/09
to mxa...@googlegroups.com
executeOnLoad:true is probably not going to work if the mxData is
created this way.

Try creating the mxData as an object (e.g. myobj = new
mxAjax.Data...) with executeOnLoad:false and then call the execute
method myobj.execute() within your checkMat() function.

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



2009/9/10 arun <arun.b....@gmail.com>:
Reply all
Reply to author
Forward
0 new messages