actionscript 3 - Binding combobox with object array? -
How to bind array objects in the combo box in the air app ..
I have an array of objects Is it that I need to force the property named in the label field of the limb combo?
var objk: Array = objkparent.children; // This object returns a comboBox.dataProvider = objk; ComboBox.labelField = objk.name;
But is not working to force it ...?
Are you sure the elements present in the objk array are called a name? I have tried which seems to work.
& lt; Mx: application xmlns: mx = "http://www.adobe.com/2006/mxml" layout = "full" & gt; & Lt; Mx: script & gt; & Lt ;! [CDATA [[Bindabal] Private Vair Dastets: Array = [{Name: "Arizona", label: "AGED"}, {name: "Tennessee", label: "TN"}, {name: "New York", label : "NY"}]; ]] & Gt; & Lt; / Mx: script & gt; & Lt; Mx: panel layout = "full" heading = "stack overflow" id = "panel" height = "100%" width = "100%" & gt; & Lt; Mx: form id = "daForm" & gt; & Lt; Mx: form heading label = "just a demo" /> & Lt; Mx: form item label = "combo box" & gt; & Lt; Mx: combo box data provider = "{daStates}" labelField = "name" /> & Lt; / Mx: FormItem & gt; & Lt; / Mx: form & gt; & Lt; / Mx: cell & gt; In addition, when binding is included, it is generally better used to use arrays instead of arrays.
Comments
Post a Comment