AnsweredAssumed Answered

How can i return a value from AJAX in Alfresco

Question asked by on Mar 3, 2015
Latest reply on Mar 20, 2015 by
Is it possible to return value from AJAX in alfresco.
I know it is possible outside alfresco by using callback ,which does not work there any possible workaround ?I am able to get the value inside ajax call in the line "alert("getting value==>"docNodeRef);".But getting the value as "undefined" outside if it.which is expected since it is an asynchronous call.I am looking for some workaround to return the value from AJAX or can i make it synchronous,how?

loadNodeRef: function Tasklist_loadNodeRef(taskId)
         url: Alfresco.constants.PROXY_URI + "/getNodeRef?taskId="+taskId,

            var docNodeRef= response.serverResponse.responseText;
alert("getting value==>"docNodeRef);


           scope: this
         failureMessage: this.msg("message.failure"),
         scope: this,
         execScripts: true