Hey DK,

You're partly right.  In my example, I only had the two tabs, but in
my production app, I have many more, and they're all making REST calls
periodically once they've been created.  The creationPolicy idea was
perfect for my example... but not so good for my production problem.

creationComplete, however isn't exactly the solution either, in this case.

I have two UIComponents with lots of children, nested within a
tabNavigator.  I need the selections on the first component (which is
created when the tabNavigator is created) to set values into a form on
the second component.  Unfortunately, it isn't created until its tab
is clicked.  So... I could use it's creationComplete to go to the
first component, examine it, get the values I need, but then, when the
first component changed, I'd still need to have a method to set the
new values...

The solution I've settled on, which I discovered on the same pages as
the creationPolicy documentation is the createChildrenFromDescriptors
method.  Basically:

parentApplication.creationComplete(function (){
   mySecondComponent.createChildrenFromDescriptors();
   anyOthersIReallyNeed.createChildrenFromDescriptors();
};

Does that seem reasonable?

/willy


On Wed, Aug 26, 2009 at 9:29 AM, Douglas
Knudsen<[email protected]> wrote:
>
> exactly what you don't need actually. :)  Although that may work for you,
> its not a good practice as this turns off the deferred instantiation
> inherent to TabNavigator among others components.  This means that all your
> tabs are created immediately regardless if they are ever viewed, slowing
> startup times.  Better to use other event such as creationComplete, etc.
>
> DK
>
> Douglas Knudsen
> http://www.cubicleman.com
> this is my signature, like it?
>
>
> On Mon, Aug 24, 2009 at 1:30 PM, Willy Ray <[email protected]> wrote:
>
>>
>> Oh Yes!  That's EXACTLY what I needed!  Thank you!
>>
>> /w
>>
>> On Mon, Aug 24, 2009 at 11:26 AM, <[email protected]> wrote:
>> >
>> > If I'm following you, I think you need to look into the creationPolity
>> > property.
>> >
>> >
>> http://livedocs.adobe.com/flex/3/html/help.html?content=layoutperformance_05.html
>> >
>> > ~Brad
>> >
>> > -------- Original Message --------
>> >  Subject: Components in tabNavigator not initialized
>> >  From: Willy Ray <[email protected]>
>> >  Date: Mon, August 24, 2009 11:58 am
>> >  To: flex <[email protected]>
>> >
>> >
>> >  Hey guys,
>> >
>> >  Here's the issue:
>> >
>> >  I have a tabNavigator that basically looks like this:
>> >
>> >  My problem is that I need all the components in all the tabs to be not
>> > null from the very beginning. I need, for example, to be able to set
>> > details.addEventListener() in the creationComplete function of the
>> > application... but details is NULL until it's been clicked on.
>> >
>> >  One way might be to refactor the creation of everything here into
>> > actionscript, but it would be a long and tedious refactoring, and I
>> > don't have the time. Thoughts?
>> >
>> >
>> >
>> >
>>
>>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: http://www.houseoffusion.com/groups/flex/message.cfm/messageid:6054
Subscription: http://www.houseoffusion.com/groups/flex/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37

Reply via email to