I've been using this method ever since I started with Cairngorm.
http://www.darronschall.com/weblog/archives/000234.cfm

It makes a lot of sense and just feels more natural to me to have the
commands handle the results and faults since they are the ones
requesting the calls anyway.

HTH,
Ben
http://www.returnundefined.com/

--- In flexcoders@yahoogroups.com, "jakana1566" <[EMAIL PROTECTED]> wrote:
>
> I have a cairngorm 2 app that uses multiple delegates to call 
> different methods of a single web service.  The problem is, each 
> delegate adds it's own "onResult" and "onFault" events, so that when 
> the web service operation is called, *ALL* of the onResult functions 
> are called instead of just the one associated with the calling 
> delegate.
> 
> For example, one delegate has the following code:
> 
> this.service = ServiceLocator.getInstance().getService
> ("sym_security_standard") as WebService;
> 
> service.addEventListener(ResultEvent.RESULT, 
> sym_security_sp_login_search_onResult);
> 
> service.addEventListener(FaultEvent.FAULT, 
> sym_security_sp_login_search_onFault);
> 
> 
> Another delegate has the following (similar) code:
> 
> this.service = ServiceLocator.getInstance().getService
> ("sym_security_standard") as WebService;
> 
> service.addEventListener(ResultEvent.RESULT, 
> sym_security_sp_group_search_onResult);
> 
> service.addEventListener(FaultEvent.FAULT, 
> sym_security_sp_group_search_onFault);
> 
> 
> 
> Since there's only one instance of the ServiceLocator, each delegate 
> is registering onResult / onFault events to the *same* object 
> instance, and therefore the onResult event triggers the onResult 
> function of multiple delegates instead of the single/target delegate.
> 
> Any ideas on how to avoid this?
> 
> Thanks in advance!
>







--
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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to