2 Replies Latest reply on Feb 16, 2009 1:33 AM by Sethumail2000

    How to bind ASP Result to Combobox

    Sethumail2000
      I am new in Flex builder. I have one page in Flex (One Combo box and submit button).
      I have one asp page.In that page i open the database connection and form the XML Result and return to the Flex.

      In Flex, how do i bind the ASP result to Combo box?

      give me example?
        • 1. Re: How to bind ASP Result to Combobox
          Richard_Abbott Level 3
          Hi Sethumail2000,
          I have a similar example - an ASP.NET page generates some fairly complex XML with (among other things) structure
          <Result>
          <Deposits>
          <Deposit>
          <various other bits>...</bits>
          <ReleaseTitle>something</ReleaseTitle>
          </Deposit>
          <Deposit>
          <various other bits>...</bits>
          <ReleaseTitle>something else</ReleaseTitle>
          </Deposit>
          etc
          </Deposits>
          </Result>

          Then I have an XML object and a combo
          deposit_list_xml: XML
          ...
          <mx:ComboBox id='deposit_list' />

          and in the receive handler from the call to the ASP.NET page I have

          deposit_list_xml = XML(result from the call);
          deposit_list.dataProvider =
          deposit_list_xml.Deposits.Deposit.ReleaseTitle;

          Hope that helps
          Richard
          • 2. Re: How to bind ASP Result to Combobox
            Sethumail2000 Level 1
            Hi Richard_Abbott ,
            Nice reply..

            same thing which i apply in my application

            var XMLResults:XML = event.result as XML;
            combo1.dataProvider = XMLResults.Cinfo;
            combo1.labelField = XMLResults.Cinfo.City_name;


            my XML is like

            <City>
            <cinfo>
            <city_name>India</city_name>
            <city_code>1</city_code>
            </cinfo>
            <cinfo>
            <city_name>USA</city_name>
            <city_code>2</city_code>
            </cinfo>
            </City>