Thanks Gordon, I've had this topic in the back of my head lately and your repeated posts kept coming to mind. :) Its nice to see it all laid out together with some guidance as well.
I'll admit I've not done much searching for it, but does anyone know if there is a good article/post/page anywhere that explains what events and processes occur, and in what order? Like creationStart is blah blah, next is initialize which is blah blah, etc. Thanks, Ben --- In [email protected], "Gordon Smith" <[EMAIL PROTECTED]> wrote: > > <rant> > > > > Several times a week someone complains that they can't seem to set data > into controls on the second, third, etc. pane of a ViewStack, Accordion, > or TabNavigator because these controls don't get created until the user > navigates to the pane they're on. > > > > Inevitably there are multiple replies "solving" this problem by setting > creationPolicy="all". Inevitably I reply that Adobe doesn't recommend > doing this because it defeats the entire purpose of the deferred > instantiation feature, which is to minimize startup time by not creating > visual components until they need to be seen. > > > > A much better technique is to use event handlers to get the appropriate > data into the controls after they get created. For example, you can use > the 'initialize' event on each pane, which won't get dispatched until > after that pane's controls exist. > > > > <mx:Accordion> > > <mx:VBox initialize="textInput1.text='Hello'"> > > <mx:TextInput id="textInput1"/> > > </mx:VBox> > > <mx:VBox initialize="textInput2.text='World'"> > > <mx:TextInput id="textInput2"/> > > </mx:VBox> > > </mx:Accordion> > > > > Using databinding is another good technique. The bindings will occur > after the controls get created. > > > > I've never seen a case where it is necessary to push data into the > controls before they exist. If you must put the data somewhere in the > meantime, store it in data vars, which have none of the startup cost of > a visual component, and then move it into the controls after they get > created. > > > > </rant> > > > > - Gordon, the Flex framework engineer who designed and implemented the > deferred instantiation feature, so listen to me on this one! > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

