2 Replies Latest reply on Feb 2, 2007 11:31 AM by WestSide

    How do you loop and create form fields dynamically?

    WestSide Level 1
      Hi,

      How would I loop and dynamically create mxml components? Say I have the following form field and I wanted to loop and create different fields and give each form field a unique id by appending the current row in the loop so the field below would be

      <mx:TextInput id="firstName_1" />

      then in the next iteration

      <mx:TextInput id="firstName_2" />

      -----------------

      <mx:Form>
      <mx:FormHeading label="Profile" />
      <mx:FormItem label="FirstName">
      <mx:TextInput id="firstName" text="{model.profileArray[0].firstName}" width="100%"/>
      </mx:FormItem>
      </mx:Form>

      Something like that. Does this have to be done using Actionscript? If so, how would I do that?

      -Westside