I've only worked with some of the Cairngorm classes that were described
in the Flex book. You're going to have to have a local model for each
sub app instance.  Your event that is fired after the search being
complete can also contain instance data about the Sub app that called it
and update your local model with the returning data accordingly. That
way you can map the returning data to the calling Search instance, and
its associated parent sub-application.

When you invoke a RemoteObject you can stipulate where the returning
data is going to go using the returned pendingCall instance which can
point to a result handler which can be local to the calling search
instance, which in turn updates your local model.

var pendingCall =  myRemoteObject.myMethod(arg1,arg2,etc.);
pendingCall.resultHandler =
mx.utils.Delegate.create(mySubApp,myReturnFunction);    

function myReturnFunction(event):Void
{
        //update your local model instance here;
}

Jeff

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of fowleryj
Sent: Monday, January 16, 2006 9:37 AM
To: [email protected]
Subject: [flexcoders] Cairngorm Question


We have been developing a fairly large application using Flex 1.5 and
the Cairngorm framework, and have recently run across what could be a
large roadblock. Our application has many sub-applications the user can
choose to run from a menu in the main application. To implement this we
are dynamically creating the children the user selects in a view stack.
All of these sub-applications rely on a particular search screen that
allows the user to find a particular person in our database. The problem
is that the sub-applications are bound to the selection the user makes
in the search screen, and are all reacting to the same events (which are
broadcast from the search screen). We would like the search screens to
function as separate instances. For example, if I broadcast a change
event from the search screen, all of the open sub-applications will
catch the event and change all of their displayed information to reflect
that of the most recently selected person. Our problem appears to stem
from the way the EventBroadcaster and FrontController are designed. All
events are broadcast in the same EventBroadcaster using the
getInstance() method, thus everything is listening for everything.

Can anyone who is familiar with the intricacies of Cairngorm propose a
way to deal with this problem? We would like to be able to return the
information about the selected person only to the sub-application that
invoked the search screen. Perhaps it is not possible to do this using
Cairngorm, and we would appreciate knowing that, too. 

If anyone has a different/better solution, we'd love to hear about it.

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



 



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