PDA

View Full Version : Reference Repeating Checkboxes


DrGoomba
02-04-2007, 12:56 AM
I am having a problem with the MX:Checkbox component. My checkboxes are being created dynamically by an arrayCollection. If i am unable to create unique id's, how do i reference the checkboxes individually? Some of these checkboxes need to be pre-selected and i need to know which ones have been selected. But it seems i have no way of knowing w/o a unique id to reference.

Ideas? Thanks!

My ArrayCollection looks something like:
<Genres>
<genre>
<genreName>Action/Adventure</genreName>
<genreID>1</genreID>
</genre>
<genre>
<genreName>Comedy</genreName>
<genreID>2</genreID>
</genre>
<genre>
<genreName>Drama</genreName>
<genreID>3</genreID>
</genre>
</Genres>

<mx:Repeater id="dGenre" dataProvider="{this.genreCollection}">
<mx:CheckBox id="genre"
label="{dGenre.currentItem.genreName}"
click="genreChanged(dGenre.currentItem.genreID)"/>
</mx:Repeater>