0 Replies Latest reply on Jun 28, 2011 2:51 AM by PaddyMc2010

    Accessing S:List Checkbox Item Renderer Outside the Renderer

    PaddyMc2010 Level 1

      Hi All,

       

      I have an S:List, with a checkbox item renderer.  I was to be able to access the selected portion of the renderer to create a new function that at the press of a button this will delect all the current selected items in the list.

       

      Doco states that i should be able to do this just by setting the selectedIndex to -1.  But not sure if this is specific to 4.5??  But it is not working for me.

       

      Below is my current list.  Outside of this list flashbuilder does not know about chkList, or even selected.  How can i get access to this to deslect all?

       

      <s:List

      id="ltattributes">

      <s:itemRenderer>

      <fx:Component>

      <s:ItemRenderer>

      <fx:Script>

      <![CDATA[

      import mx.events.ItemClickEvent;

      protected function chkList_changeHandler(event:Event):void

      {

      var e:ItemClickEvent = new ItemClickEvent(ItemClickEvent.ITEM_CLICK, true);

      data.selected = event.currentTarget.selected;

      e.item = data;

      e.index = itemIndex;

      dispatchEvent(e);

      }

      ]]>

      </fx:Script>

      <s:CheckBox id="chkList" selected="false" label="{data.displayname}" change="chkList_changeHandler(event)"/>

      </s:ItemRenderer>

      </fx:Component>

      </s:itemRenderer>

       

       

      Thanks