I usually create such object in the main application and then use an
approach similar to Valdhor's (Steve isn't it? :-)

The component has private (or public) variable that references the
application one ie:

main.app:

var myGlobalObject:myObjectType

component:

var myGlobalObjectRef:myObjectType

and then <component myGlobalObjectRef="myGlobalObject" (this will need a
couple of bindable or meta tags cannot remember at the moment)

or better (i preffer actionscript)

the component has a start method of the type

start(globObject:myObjectType)
{
   myGlobalObjectRef=globObject
}

and in amin.app on creationComplete or something similar call the start
method of the component passing the global var

On Thu, Nov 13, 2008 at 9:42 PM, valdhor <[EMAIL PROTECTED]> wrote:

>   Patrick
>
> This is probably not best practice but you can create your VO in the
> main application and access it with Application.application.myVO from
> anywhere.
>
> Or, you can inject the VO into your custom components by creating a
> public variable in the component.
>
>
> --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>,
> "pbrendanc" <[EMAIL PROTECTED]> wrote:
> >
> > I am retrieving data from a service and saving this in a VO. This is
> > done within a component (actually within a PopUp Search window) - I am
> > saving the currently selected employee data record.
> >
> > However I want to make the VO data accessible across the entire app
> > and to all components in the app (iow - this is application wide
> > data). (BTW - This is static data that will not change - basically it
> > is header info that appears on multiple forms etc.).
> >
> > (I know I can bind form elements to the VO for display purposes - just
> > not sure how/where to create the VO).
> >
> > Some specific qns:
> >
> > If I define the VO at the application level, how do I pass this to a
> > component (PopUp) so it can be populated and later made available to
> > other app components?
> >
> > How do I reference the VO from other components?
> >
> > TIA,
> > Patrick
> >
>
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[EMAIL PROTECTED],

Reply via email to