Topic: wait a xajx function for compeletting another xajax function

How can i force a function for waiting another function to complete.
In another word when  the user click on a button two functions called simultaneously,one of them use result of another saved on a Form's field, how do the function wait for setting needed values prepared from another function?

Re: wait a xajx function for compeletting another xajax function

You can use synchronous mode calls but you can do it all in one call by calling the second function from the first on the server passing the data it needs.

http://community.xajax-project.org/topi … -function/

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.

Re: wait a xajx function for compeletting another xajax function

thanks edrobinson.
but the first function is called with the onblur event of text input and another is called with onclick of button.
in first function the calculated values must be prepared and consume in second function(in onclick) .
but the second function finished while the first function is being run and the second use wrong values.

Re: wait a xajx function for compeletting another xajax function

You can use the call bellow after you finish you code:
$objResposta->script('second_function()');

or

you can use this:
xajax.callback.global.onComplete = function()
            {
                /*here you can do your call to second function
               this will happen after all xajax calls*/
            };

Re: wait a xajx function for compeletting another xajax function

This looks like an endless loop to me...

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.