I agree with Romain's solution.

The way I chose to solve this problem was create all my views (forms, reports, 
etc) as custom mxml components, and instantiate these using 
myViewStack.createChild().  That way the component isn't instantiated until it 
is actually requested.  The one gotcha to this approach is that there is no 
"eval" of custom component names at runtime (as the component must be 
compiled), so if you're passing a component name to your view stack, you must 
first get a reference to a compiled component, which I am doing via an AS class 
containing a switch/case statement based upon the app name strings I am passing 
from the tree component.  Not as elegant as I wanted, but it does work, and 
work well. 

There may be a more elegant solution, but this is what I came up with given my 
level of knowledge at the time.

With a little bit of work with HistoryManager, you can get the app to flip 
through a user's instantiated views using the back/forward button of the 
browser.

Jeff Battershall
Application Architect
Dow Jones Indexes
[EMAIL PROTECTED]
(609) 520-5637 (p)
(484) 477-9900 (c)

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of r0main
Sent: Tuesday, April 19, 2005 11:56 PM
To: [email protected]
Subject: [flexcoders] Re: Flex/Cairngorm architecture




Hello,
a simpler solution is to have a viewstack with you 15 views (may be any 
container (vbox, hbox, vdividedbox, etc.)), that viewstack standing for example 
on the right of your tree. Now when people select a leaf on your tree, simply 
change the viewstack index !
(ps: it has nothing to do with Cairngorm, this is a Flex design solution)

Romain


--- In [email protected], "Rafael M. Martinelli" <[EMAIL PROTECTED]> 
wrote:
> Hi everybody!!!
>  
> I'm facing a little architecture problem. I'm building an app with
15 forms
> and a lot of reports and charts. I decided to use a Tree as a menu
since I
> have a lot of views. When the user clicks at the Tree I load a mxml 
> file using a Loader component.
>  
> The problem is that the Loader just load mxml file with the
<mx:Application>
> tag or with the </cairngorm:CairngormApplication> tag when using the 
> framework. I think that's not the best way. I would prefer to load a 
> component instead of an application everytime the user request, for
example,
> a form.
>  
> Maybe it's a simple question, but I couldn't solve it.
>  
> Thanks.
>  
>  
> Rafael M. Martinelli
> Gerente de Solu��es Web
> Synex Technologies Co.
> Fone/fax: +(55) 11 3071-3363
> [EMAIL PROTECTED]
> www.synex.com.br <http://www.synex.com.br/> 
>  
> 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.9.17 - Release Date: 19/4/2005





 
Yahoo! Groups Links



 






 
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