Data service calls are asynchronous and do not block code execution.

 

Use the AsyncToken to track the data service calls, and a result handler
function to invoke rest of the code when all of the calls have returned.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of sunitaleena
Sent: Friday, May 18, 2007 12:22 PM
To: [email protected]
Subject: [flexcoders] Flex help

 

Hi, 

I am having this problem . I am trying to call this function from a
button' s click event. The function is like this:
public function Insert():void {
myResult.deleteorder(orderid);

for (var i:int = 0; i < myData.length; i++ ) {

var newProduct:Product = myData[i] ;

myService.insertsp( newProduct ) ;
}//end for loop

var uv:URLVariables = new URLVariables();
var request:URLRequest = new URLRequest
("OrderReview.html");
uv.ordern = lblordern.text;
request.data=uv;
navigateToURL(request,"_self"); 

}

When I was testing with 2 or 4 records it was working fine. Now I am 
testing with real data. It just doesn't work . This doesn't wait for 
the for loop to be finished completely and starts processing the 
other steps. I want the other steps to be processed after the loop is 
done. Please help. Is there some wait command in Flex? I am a new 
bee..

Thanks in advance.



 

Reply via email to