views:

572

answers:

1

I have an an array of objects that I use as the datasource for my repeater.

<mx:Repeater id="categoryRepeater" dataProvider="{this.allCategories}">
<mx:HBox>
<mx:Spacer width="20"/>
<mx:CheckBox id="categoryCheckBox" label="{categoryRepeater.currentItem.question}"/>
</mx:HBox>
</mx:Repeater>

I would like to be able to tell which of the checkboxes in the list have been checked, but I'm not sure how to do it. I know I can add a function when it's clicked, but I don't know how to tell which checkbox called the function.

+1  A: 

Use the currentIndex property.

dirkgently
can you point me in the direction of an example? Here's what I'm trying: <mx:CheckBox id="categoryCheckBox" click="myFunction(categoryRepeater.currentItem)" .... /> However it appears that the function is never called
KevMo
sorry, that should say categoryRepeater.currentIndex
KevMo
The link to the Flex 3 documentation I posted originally, has an example at the bottom. Just replace currentTarget.getRepeaterItem() by currentTarget.currentIndex and try.
dirkgently