There is a simple answer to your question, but before I tell you, I need
you to understand the ramifications.  The behavior your see is called
"deferred instantiation" and is the default behavior of many of the Flex
navigation containers.  Its purpose is to improve the start-up
performance of the Flex app.

 

The best way to handle issues like this is to use binding, or an event
process of your own, to "pull" the data you want into the child views
when they are viewed.

 

Now, the answer to your question is: on the Accordion tag, set
creationPolicy="all".

 

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of ecpmaz
Sent: Tuesday, January 23, 2007 4:52 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] force to preload UI children

 

I want to force any UI Container to preload its children. I explain
myself. For instance I have an accordion which contains 2 tabs. 
The first one is automatically loaded. But I can't acess to the second's
children as long as the user has not clicked on it to display it!

<mx:Accordion>
 <mx:VBox label="1"><mx:Button id="b1" label="box1" /></mx:VBox>
 <mx:VBox label="2"><mx:Button id="b2" label="box2" /></mx:VBox>
</mx:Accordion>

here I won't be able to execute this :
b2.label = "hop changed";
as b2 will be null.

Any idea ?
I tried all the validateProperties/validateSize/validateNow... but  it
won't do anything...

Thank you

Mathieu LEMAIRE

 

Reply via email to