Hello. I have a new blog.

I've moved this blog to the following URL Kerkness.ca. Thank you for visiting, please update your bookmarks.

Friday, October 3, 2008

Force creation of complete ViewStack with creationPolicy when building a form across multiple views : Flex Tip

Here's a tip which might be useful for some people.  Sometimes when building a Flex/Adobe Air interface you may want to have form elements which are built across multiple views of a ViewStack, or TabNavigator.  For example I have a contact form which has some rarely used fields contained in a secondary Tab in my form.

Problem with this approach is that the default value of a Container's creationPolicy is 'auto'.  This means child components are only created when they are needed.  If your user never looks at the extra tabs/view stack layers then these form elements are not available if you need to get values or set values for them.

The Solution is to simple set the creationPolicy for your ViewStack or TabNavigator to 'all'.  This will ensure that all child elements are created up front and are available when needed regardless if the user looks at them or not.

No comments:

Post a Comment

Thank you for the comments.