It is possible to define a new resut object for the first query. In the new
result object get the data returned from the server and call another service
with its own result object. It seems to work well for me.
var qry1Result = new Object();
var qry2Result = new Object();
qry1Result.onResult = function(result) {
if (result.getItemAt(0).something = "somethingThatYouWant") {
service.qry2(qry2Result, result.getItemAt(0).something);
} else {
// do something else
}
}
qry2Result.onResult = function(result) {
// do second thing
}
service.qry1(qry1Result, variable);
wade // hope i understood your question
Hunt?r - 01 May 2004 00:47 GMT
I would concur with Wade , although I code it slightly differently which I'm
sure doesn't matter, but here is my equiv...
First Call:
function callOne(){
// Do whatever server calls here you wish
getData.callOneToCfc(); // This for instance calls to the cfc a
function called "callOneToCfc"
}
Now let's say you want to wait until the results come back before making the
next call which needs the data from the first, and needs to take that data and
send it to the server for the next result... You create a result function like
this:
Note: This function will not commence until the result set is processed and
returned from the server
function callOneToCfc_Result(result){
getData.nextCallToCfc({varToSend: result});
}
Then ....
function nextCallToCfc_Result(result){
getData.callAfterThatToCfc({varToSend: result});
}
And so on.....
Of course you could do this all iun a loop which I believe would handle your
dynamics you were speaking of...
-- H?nter