1 Reply Latest reply on Oct 11, 2007 6:45 AM by Gregory Lafrance

    How to access TileList checkboxes?

    cterrebonne
      I have a question that should be relatively easy for you veteran Flex developers. I am rendering a series of checkboxes into a TileList component via a dataProvider. How can I enumerate all checkboxes to determine the checked state of each?

      Here is how I generate my TileList:

      <mx:TileList allowMultipleSelection="true" click="handleCheckState(event.target)" id="tlDeptList" maxColumns="10" rowHeight="30" columnWidth="70" itemRenderer="mx.controls.CheckBox" x="10" y="79" width="478" height="229"/>

      I can get the data from the tlDeptList.dataProvider property, but I can't seem to locate where the checked (selected) state for the rendered checkboxes is located. <shrug>

      Thanks in advance...

      Regards,
      Chris
        • 1. Re: How to access TileList checkboxes?
          Gregory Lafrance Level 6
          This may help.

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
          <mx:Script>
          <![CDATA[
          import mx.containers.Box;
          import mx.controls.CheckBox;
          private function handleCheckState(event:Event):void {
          var tempCB:CheckBox = CheckBox(event.target);
          trace(tempCB.selected);
          }
          ]]>
          </mx:Script>
          <mx:TileList allowMultipleSelection="true" click="handleCheckState(event)"
          id="tlDeptList" maxColumns="10" rowHeight="30" columnWidth="70"
          itemRenderer="mx.controls.CheckBox" x="10" y="79" width="478" height="229">
          <mx:dataProvider>
          <mx:String>Item1</mx:String>
          <mx:String>Item2</mx:String>
          <mx:String>Item3</mx:String>
          </mx:dataProvider>
          </mx:TileList>
          </mx:Application>