2 Replies Latest reply on Aug 17, 2009 1:22 PM by wendy888

    How to use comboBox as the key to display multiple textInput fields?

    wendy888 Level 1

      All,

          I am new in Flex and need to help!

      I have selected rows from database and need to display on one comboBox with several textInput fields. The function need to

      1) After the page complete load, the comboBox display the ID (unique key of the row).

          and all fields should fill by the columns with the ID. ( I did it with only one textInput)

      2) When it selects an ID from comboBox, all fields with the ID should change accordingly.

      See attached file.

      Please help.

      Thank you in advance!

        • 1. Re: How to use comboBox as the key to display multiple textInput fields?
          _Natasha_ Level 4

          Hi,

           

          there is an example. All you need to receive your data and

           

          <?xml version="1.0" encoding="utf-8"?>

          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

          <mx:XML id="tstData" xmlns="">

          <yueventlists>

          <yueventlist event_id="EMB09">

            <event_id>EMB09</event_id>

            <stvcoll_desc>Albert Einstein College of Med</stvcoll_desc>

            <LOCATION_NAME>Bronx comm center</LOCATION_NAME>

            <LOCATION_ROOM>101</LOCATION_ROOM>

            <LOCATION_CONTACT />

            <PHONE />

            <FAX />

            <STREET />

            <CITY_PROVINCE>New York</CITY_PROVINCE>

            <STATE>NY</STATE>

            <ZIP>10471</ZIP>

            <COUNTRY />

            </yueventlist>

          <yueventlist event_id="EMB10">

            <event_id>EMB10</event_id>

            <stvcoll_desc>Albert Einstein College of Med</stvcoll_desc>

            <LOCATION_NAME>Bronx Red Lobster</LOCATION_NAME>

            <LOCATION_ROOM>102</LOCATION_ROOM>

            <LOCATION_CONTACT />

            <PHONE />

            <FAX />

            <STREET />

            <CITY_PROVINCE>New York</CITY_PROVINCE>

            <STATE>NY</STATE>

            <ZIP>10463</ZIP>

            <COUNTRY />

            </yueventlist>

          <yueventlist event_id="YUD09">

            <event_id>YUD09</event_id>

            <stvcoll_desc>Yeshiva University</stvcoll_desc>

            <LOCATION_NAME>Chelsea Piers Pier Sixty</LOCATION_NAME>

            <LOCATION_ROOM>103</LOCATION_ROOM>

            <LOCATION_CONTACT>0</LOCATION_CONTACT>

            <PHONE>0</PHONE>

            <FAX>0</FAX>

            <STREET>0</STREET>

            <CITY_PROVINCE>New York</CITY_PROVINCE>

            <STATE>NY</STATE>

            <ZIP>10033</ZIP>

            <COUNTRY>0</COUNTRY>

            </yueventlist>

            </yueventlists>

           

          </mx:XML>

          <mx:Form x="126" y="57">

          <mx:ComboBox id="cmbID" dataProvider="{tstData.*}" labelField="@event_id"></mx:ComboBox>

          <mx:FormItem label="School Name">

          <mx:TextInput id="schoolName" text="{cmbID.selectedItem.stvcoll_desc}"/>

          </mx:FormItem>

          <mx:FormItem label="Location Name">

          <mx:TextInput id="locName" text="{cmbID.selectedItem.LOCATION_NAME}"/>

          </mx:FormItem>

           

          </mx:Form>

          <!-- and so on... -->

           

          </mx:Application>

          • 2. Re: How to use comboBox as the key to display multiple textInput fields?
            wendy888 Level 1

            It works great!

            Thank you very much.