views:

21

answers:

1

Having read about Container creationPolicy (thanks all the references in StackOverflow)

I have a problem/question:

I have a TabNavigator and AS code in the initial Tab needs to reference components of second tab (a Canvas with multiple children).
But the components of the second tab are null until that Tab is rendered.

According to the documentation as I read it, I should be able to set creationPolicy on the second tab/Canvas to "all"; the TabNavigator will instantiate all its top-level children, even with its multi-view creationPolicy="auto"; and I was hoping that when creating the child Tab/Canvas, that the creationPolicy="all" of that single-view Container would be honored.

But it appears that this is not the case; if the TabNavigator has creationPolicy="all" then the second Tab is populated (but so are the third, fourth, ...); but with "auto" the second Tab is created, but not populated, even though its creationPolicy="all".

Is there a way to get just selected Tabs to pre-instantiate?

A: 

Is there a way to get just selected Tabs to pre-instantiate?

No! What you are seeing is expected behavior. If the Tab's primary child is not created then that child cannot create all of it's children.

You may consider refactoring your code a bit; as one component access data in another component that is not it's child breaks encapsulation.

www.Flextras.com
To clarify the original post: the TabNavigator *does* create the Tab's "primary child" (the main Canvas of each Tab); The problem is that said Tab/Canvas does not create *its* sub-components, even though its creationPolicy="all".
Jack Parker
Post up a demo / code demonstrating the issue.
www.Flextras.com