开发者

object object embedded in square bracket in combobox

开发者 https://www.devze.com 2023-03-28 13:39 出处:网络
Following is my code: <?xml version=\"1.0\" encoding=\"utf-8\"?> <mx:Application xmlns:mx=\"http://www.adobe.com/2006/mxml\" layout=\"absolute\">

Following is my code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
    <![CDATA[
        import mx.controls.Alert;
        import mx.collections.ArrayCollection;
        import mx.utils.ArrayUtil;
        import mx.utils.ObjectUtil;

        [Bindable] 
            private var zipdataProvdr:ArrayCollection = new ArrayCollection([{name:           "test", file: "test"},{name: "elm34001", file: "elm34001"}, {name: "elm34003", file: "elm34003"}, {name: "elm34005", file: "elm34005"}, {name: "elm34009", file: "elm34009"},{name: "elm34011", file: "elm34011"}, {name: "elm34013", file: "elm34013"}]);
     ]]>
     </mx:Script>


     <mx:ComboBox  
         id="cbobxz" 
         dataProvider="{zipdataProvdr}"
         x="10" y="49" width="189" height="23">
     </mx:ComboBox>
     <mx:Label x="247" y="48" text="ShapeFiles" width="78" height="24"/>
     <mx:ComboBox x="350" y="50" id="cbobxs" dataProvider=""></mx:ComboBox>

         </mx:Applicat开发者_如何学Goion>

On the browser I should see a dropdown box with all the files by their names, instead I can see a dropdown box with [object object].


You want to change your code to use label instead of name:

private var zipdataProvdr:ArrayCollection = new ArrayCollection([{label: "test", file: "test"},{label: "elm34001", etc.
0

精彩评论

暂无评论...
验证码 换一张
取 消