With Cairngorm, have your commands implement the Command and the Responder, then you have the onResult and onFault calls to handle as you will. You pass the reference of the command to the delegate, and you should be good to go. The delegate does the real work of hitting up the webservice and the command executes the call, and handles the result of that call whether it be successful or a fault.

 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of JesterXL
Sent: Tuesday, July 04, 2006 10:34 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Handle result/fault from webservice call in Cairngorm 2

 

Add event listeners on the call since he's a WebService for "fault" and "result".

 

call.addEventListener(mx.rpc.events.FaultEvent.FAULT, onFault);

call.addEventListener(mx.rpc.events.ResultEvent.RESULT, onFault);

 

----- Original Message -----

Sent: Tuesday, July 04, 2006 6:15 AM

Subject: [flexcoders] Handle result/fault from webservice call in Cairngorm 2

 

I setup an new Project in Flex 2 using Cairngorm 2 and now I'm trying to handle result/fault coming from a webservice. I created a subclass of ServiceLocator for the webservice. When I debug the call it works and I get data:

 

var call:AsyncToken = ServiceLocator.getInstance().getService("webservice").getData();

 

But now I dont know how I can handle this result/fault. In Flex 1.5 we have do it this way:

 

var call:Object= ServiceLocator.getInstance().getService("webservice").getData();

call.resultHandler = resultHandler(event);

call.faultHandler = faultHandler(event);

 

But now it dont work and I have no idea how to do it. I also looking on Adobe Labs but there ist still docs for Cairngorm 0.99. So, can any one help me to solve this problem?

 

Thanks, Artur

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





YAHOO! GROUPS LINKS




__,_._,___

Reply via email to