combo box data binding

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default combo box data binding

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
    xmlns="*" creationComplete="send_data()">

    <mx:HTTPService id="userRequest"
    url="http://suse/websites/team/Mahendra/createseries.php"
    useProxy="false" result="results(event);"/>

    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    public var arr:ArrayCollection;
    [Bindable]
    public var aray:Array;

    private function results(event:ResultEvent):void
    {
    arr = event.result.Mylog;
    //aray= arr.toArray();
    //Alert.show(arr.length.toString());
    Alert.show(arr.toString());

    }
    private function send_data():void {
    userRequest.send();
    }
    ]]>
    </mx:Script>



    <mx:ComboBox id="hello" dataProvider="{arr}" x="86" y="253"
    width="133" >
    </mx:ComboBox>


    </mx:Application>

    my php script returning me
    <?xml version="1.0" encoding="utf-8"?>
    <Mylog>

    <series>Convertible</series>
    </Mylog><Mylog>

    <series>Sedans</series>
    </Mylog><Mylog>

    <series>Sport</series>
    </Mylog>


    this is my code . I want to fill combobox with the all values of series
    please help me . Means bind the combo box with httpservice result

    007none Guest

  2. Similar Questions and Discussions

    1. How to display a set of data in a data grid when drivenby a combo box?
      I am trying to build a page where the user can select a syle of food (i.e. chinese, italian etc) from a combo. I would then want the relevent...
    2. Data Binding
      I have a webService, dataSet, comboBox and a sumbitButton. The combobox loads and displays Brands from my cfc. I press submit and look at the...
    3. Complex data binding question, binding child objects of a custom collection.
      I have a custom collection of objects, each of which includes a child object called MyUserOpener. In declarative binding, I can bind this property...
    4. Binding Data
      Currently, when I bind data to a DataGrid, I use a function as such: Dim conGrid As SqlClient.SqlConnection Dim daGrid As...
    5. combo box and data
      Hello, I have a form with a combo box to look up account numbers,description,route and stop. This works fine. What I need to learn is how to get...
  3. #2

    Default Re: combo box data binding

    Hi,
    set the labelField of the ComboBox to "series" as show in the code below.

    Hope this helps.

    <mx:ComboBox id="hello" dataProvider="{arr}" labelField="series" x="86"
    y="253" width="133" >
    </mx:ComboBox>


    SujitG Guest

  4. #3

    Default Re: combo box data binding

    I have changed my php code it will return me this xml

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

    <product productId="1">
    <series>Convertible</series>
    </product>

    <product productId="2">
    <series>Sedans</series>
    </product>

    <product productId="3">
    <series>Sport</series>
    </product>

    </Mylog>


    then i have changed 2 place
    arr = event.result.Mylog.product;

    and yeah label field in combo

    Thanks


    007none Guest

  5. #4

    Smile Re: combo box data binding

    how to bind the combo box value from webservice , to input for another webservice
    abcd Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139