0 Replies Latest reply on Jan 19, 2007 12:08 PM by Neil_P_Davis

    Dynamic Form elements and how to process them

      I am a completely green flex developer with little experience. I am currently consuming HTTPServices and also posting data to them. I've got this down. I've built a form which has a set of checkboxes in a datagrid. It dynamically builds this list from an xml provided by HTTPService via php. Here is the code:

      <mx:DataGrid x="10" y="10" width="470" height="289" dataProvider="{pluginsListRequest.lastResult.family}" id="familyList>
      <mx:DataGridColumn headerText="" >
      <mx:Component className="pluginFamilies" id="pluginFamiliesItemRenderer">
      <mx:CheckBox selected="{data.selected}" change="data.selected=selected" label="{data.name}"/>

      GRRR the code is a little hard to read like this but this editor won't let me post it any other way. I assure you it's formatted beautifully at my end.

      This produces a list of checkboxes with labels inside of a datagrid control.

      My question is this... Since this list will be changing, I can't statically define it. However, I need to iterate over this list and produce a POST request to post the data in the form. The script I am posting to, will create an xml which will then be written to the database. It doesn't really care what the incoming data looks like, it will generate an xml out of any POST request.

      How do I iterate over this list, using action script, and pull the labels/indexes for each one that is checked? I have been hammering on this for 2 days and am getting nowhere. It renders fine, I just can't figure out how to iterate over this dynamic control at runtime. I am sorry for being such a noob but I am learning the way of flex; it's pretty confusing for a novice.