Flex: how can I load data and then create the required components?

I have a flex application that has three tabs. Each of these tabs has a component that loads a form, which has a dropdown combo box. These combined fields depend on external data to be filled in correctly. The first tab is currently being created and the data to be filled in the combo box is missing. The combo box for the second tab is populated with the required data.

What the identifier needs to do is create an event that is dispatched after the data is loaded. When this event happens Id like to create these tabs or tab components. Is there a way to wait for the data to load before the application creates the components?

0


source to share


1 answer


You can create components in actionscript.

this code will create a ComboBox:



var newBox = new ComboBox ();
newBox.dataProvider = aDataProvider;
// You could alternativley use (v / h) box.addChild (newBox)
// to add it as a child of a specific element
Application.application.addChild (newBox);

You can use this technique to create components in actionscript, you still need to set all the properties that are usually set in mxml, but they all have the same name.

+1


source







All Articles