Hi YJ, RocketBoots is working with a development team on a large (100s of classes) Flex 1.5 Cairngorm application at the moment with potentially many instances of the same "sub-application" (we call them workspaces) around at the same time - e.g. two searches, three articles, a calculator etc.
Here's our solution, which is working nicely. Each type of workspace has it's own viewHelper class. Each workspace instance has it's own viewHelper instance. Because there are multiple instances it was going to be difficult to use the ViewLocator and ModelLocator, so we didn't. Instead, when workspace instance X broadcasts an event, we include a reference to the workspace's viewHelper in the event data. The command's execute method caches this viewHelper in an instance variable, and its onResult method uses the same viewHelper to display the results. The viewHelper instance also holds our model, using instance instead of static variables (although we can imagine using statics in some situations, for bits of the model shared across all workspaces). Happy to answer further questions about this approach - this one has been in the backlog of things to blog for a while. Cheers, Robin ______________ Robin Hilliard Director - RocketBoots Pty Ltd Professional Services for Macromedia Technologies http://www.rocketboots.com.au For schedule/availability call Pamela Higgins: w +61 7 5451 0362 m +61 419 677 151 e [EMAIL PROTECTED] or Direct: m +61 418 414 341 f +61 2 9798 0070 e [EMAIL PROTECTED] *** Register for WebDU http://www.mxdu.com 2-3 March 2006 *** On 17/01/2006, at 1:37 AM, fowleryj wrote: > 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 <*> 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/

