I have a list that uses a checkbox itemrenderer. The dataprovider is a collection of people. When I load the data from a file, each list item shows the person's name (last, first -- labelFunction), and the checkbox's selected property shows the person's included property. I.e.,
Smith, Doug - [x] Williams, Bob - [ ] Morris, Anne - [x]
However, each person also has an active property. I want to disable the checkbox for people who are inactive (meaning, "you can't include inactive people"). I have tried several methods to get this to work, including what's suggested here http://forums.adobe.com/thread/416786 to do the same thing in a datagrid. However, none of them work and all the checkboxes are enabled regardless of the person's active status. Here is my basic code:
<mx:List id="peopleIncludedList"
dataProvider="{someProvider}"
labelFunction="peopleLabelFunction">
<mx:itemRenderer>
<mx:Component>
<mx:CheckBox change="onChange(event)"
selected="{outerDocument.isIncluded(data)}">
<mx:Script>
<![CDATA[
private function onChange(e:Event):void
{
...
}
]]>
</mx:Script>
</mx:CheckBox>
</mx:Component>
</mx:itemRenderer>
</mx:List>
Any help on this would be greatly appreciated. Thank you.
-- Ian