Hi Ryan,

Tracy is kind enough to consistently answer many questions on this list.
Let me jump in here to help out.  In answer to your original question:

Can I write to something a tab if it is now displayed yet in flex???

No, you can not reference an object that has not been instantiated yet. 
TabNavigators and other navigator containers (Accordion, ViewStack...),
only instantiate the objects in the first child c0ntainer initially. 
While your problem may be solved by using creationPolicy="all", Tracy's
advise is sage; since this will lead to performance degradation and
negate deferred instantiation.

The preferred method, very typical when using MVC, is to cast the result
of the service call to a bindable value object (VO) that resides in the
ModelLocator.  Then bind {} the properties of the VO to the appropriate
controls.

So, instead of:

companyname = obj.companyname;

You would have something like:

<mx:TextInput id="companyname" text="{ myModel.myObjVO.companyname }"/>

This way, when the control is instantiated, the binding mechanism will
get the data; instead of trying to populate the text before the control
is created.

-TH



--- In [email protected], "Ryan" <[EMAIL PROTECTED]> wrote:
>
> Tracey, in that case how would get around this problem? I'm working a
> very large flex app with the same problem. I have 100's of feilds and
> staying true to MVC architecture I have everything as modules.... but
> I run into this same problem.
>
> I agree it is bad practive, but short of creating a variable to house
> each value and binding the text fields to that value I don't see a
> working around, plus I hate to do that b/c I all those variables are
> unnecessary.
>
> I would love some help here,
>
> Ryan
>
> --- In [email protected], "Tracy Spratt" tspratt@ wrote:
> >
> > But creationPolicy="all" is bad practice, and you will be very sorry
> > some day if you use it habitually.
> >
> > Tracy
> >
> >
> >
> > ________________________________
> >
> > From: [email protected] [mailto:[EMAIL PROTECTED]
On
> > Behalf Of timgerr
> > Sent: Monday, May 19, 2008 12:53 PM
> > To: [email protected]
> > Subject: [flexcoders] Re: Write Data to Tab Navigater
> >
> >
> >
> > Thanks, That worked well.
> >
> > --- In [email protected]
<mailto:flexcoders%40yahoogroups.com>
> > , "Battershall, Jeff"
> > <jeff.battershall@> wrote:
> > >
> > > myTabNav.creationPolicy = "all";
> > >
> >
>


Reply via email to