Is there a way to detect or wait on the completion of an Ajax call? I saw the info in this thread: http://www.hyfinity.net/wmforum/showthread.php?tid=82
but this shows how you create functions based on a control that executes the call. In my scenario, I am using javascript to make the call and the script may be invoked from several different form objects.
but this shows how you create functions based on a control that executes the call. In my scenario, I am using javascript to make the call and the script may be invoked from several different form objects.
RE: How can I wait for ajax call to complete from script?
I'm unsure if your AJAX call is constructed as part of a Partial Page or completely independent.
There are some common techniques for achieving what I think you are describing.
You can have a look at some examples of these techniques in file
...\design\tomcat-design\webapps\formmaker\js\cssClassParser.js
Search for hyf.css.ClassManager.prototype.load
You will find a similar example in file ...\design\tomcat-design\webapps\formmaker\js\predefinedFnParser.js
Search for hyf.fn.FunctionManager.prototype.load
The technique is to check for something that you know will be true when your AJAX call has completed, otherwise wait. You should ensure your sequencing is robust enough to avoid race conditions, infinite loops, etc.
Important! Please do not change these files because they are part of the Design Studio.
I hope I haven't misunderstood your question.
Kind Regards
Abdul