View Full Version : ajax method

Feb 05, 2009, 9:31 AM
question: you can call a coolite ajaxmethod inside any javascript function right? whenever i do "Coolite.AjaxMethods.serverFunction()" i am getting a javascript error saying object does not support property or method, please help

Feb 05, 2009, 9:36 AM

When define this function? Also what rendered to the page? Can you post Coolite script block which rendered to the page

Feb 05, 2009, 9:46 AM
ok, im creating a dynamic window using this javascript code, then inside that window is a toolbar with a button which calls a function that has an ajax method inside it.. of course in the server side code i got a public non-static function "check()" with an [AjaxMethod] attribute

var win;
win = Ext.getCmp('extwin_' + dv.getRecord(node).get('id'));
var toolbar = [{
tooltip:{title:'Unpublish', text:'Unpublish the selected question(s)'},
text: '',
handler: checkSelection ,

win = new Ext.Window({renderTo: Ext.getBody .............


var checkSelection = function()

can this be done with this button? because in the examples, the ajax method was triggered by a coolite control

Feb 05, 2009, 10:03 AM

I mean where define ajax method: in page, in master page or in user control? May be it is id's issue (because if ajax method define in master page or in user control then need to add client id to the calling or use AjaxMethodProxyID attribute - see http://forums.ext.net/showthread.php?1372

Also it can be a cache issue - several days ago we added ignore ajax method cache under debug. You can update from SVN and retest or restart your web server to clear cache (IIS or local web development server)

Can you investigate**generated *Coolite script block or post it for investigate? Does the proxy for this function is presented in this block

Feb 06, 2009, 7:43 AM
i got it working now by appending the ID of the user control to the client side call "Coolite.AjaxMethods.check();" to "Coolite.AjaxMethods.ucID.check();" . i did not make use of the AjaxMethodProxyID attribute but it is still working by just using the ID and not the client ID as mentioned. i don't know if it got something to do with that the javascript call to the AjaxMethod is in the same user control that contains the server side AjaxMethod. but thanks again for the reference