1 Reply Latest reply on Mar 10, 2010 11:35 AM by Zolotoj

    CheckBox - set selected property

    Zolotoj Level 3

      I am trying to set selected property to provided data.


      <mx:CheckBox id="check" selected="{XML(data).selected}"


      and data looks like this:


        <action>Audit Existing Inventory</action>




      but the checkbox is selected even <selected>false</selected>. Can someone explain why?



        • 1. Re: CheckBox - set selected property
          Zolotoj Level 3

          Ok, here is complete code of my itemRenderer that I am using in dataGird:


          <?xml version="1.0" encoding="utf-8"?>
          <mx:ComboBox xmlns:fx="http://ns.adobe.com/mxml/2009" 
                    import mx.events.FlexEvent;
                    import mx.collections.ArrayCollection;
                    import mx.controls.CheckBox;
                    public var datas:XML;
                    override public function set data(value:Object):void
                         dataProvider = datas["sku" + value.sku];
                    public function saveCheckState(evt:Event):void
                         var dataProviderItem:Object = dataProvider.getItemAt(dataProvider.getItemIndex(selectedItem));
                         dataProviderItem.selected = CheckBox(evt.currentTarget).selected;
                         dataProvider.setItemAt(dataProviderItem, dataProvider.getItemIndex(selectedItem));     
                         <mx:HBox width="100%">
                              <mx:Label text="{XML(data).action}"/>
                              <mx:Spacer width="100%"/>
                              <mx:CheckBox id="check" selected="{XML(data).selected}"
          What's happening is when I drop this combo down all checkboxes are shown as selected.