0 Replies Latest reply on Jul 15, 2010 11:30 AM by josyeh2

    Cairngorm: sending multiple delegates, combining result to only one responder

    josyeh2

      Hi All,

       

      I have a business delegate that launches an HTTP request that returns XML data.  Normally, this result would trigger a responder to deal with the resultant XML.  However, I'd like to launch two business delegates at once, combine the resultant xml (which appears in e.result down here below) and then issue the responder.result() step.

       

      Is this possible?  Thanks for any input!

       

      - Joseph

       

      business/XmlDelegate.as:

       

              public function getXmlForComponent(component:ComponentVO):void{
                  //Define Parameters for HTTPService
                  var params:Object=new Object();
                  params.component=component.component;
                 
                  var token:AsyncToken = service.send(params);
                  var callResponder:Responder = new Responder(onResult,onFault);
                  token.addResponder(callResponder);
                 
              }
             
              public function onResult( e:ResultEvent):void{
                  trace("[Delegate] CdetsDelegate - onResult");
                  responder.result(new ResultEvent(ResultEvent.RESULT,false,true,e.result));
              }