Flex 3: Error: the repeater does not execute ... I know why, but I do not know how to fix it

I have the following code:

<mx:Repeater id="showNames" dataProvider="{parentApplication.bfa1aStudents}"> <mx:Text text="{parentApplication.getStudentName(showNames.currentItem)}" color="#8ab534" click="nameSelected(Number(showNames.getRepeaterItem(showNames.currentIndex)));" selectable="false" mouseOver="parentApplication.switchCursor(true);" mouseOut="parentApplication.switchCursor(false);" /> </mx:Repeater> 

I know that you cannot use currentItem or currentIndex on a click ... and this problem has been fixed with the getRepeaterItem () function, but I'm not sure exactly how to use it. DP is a bunch of numbers representing user IDs, if that matters. If someone can help me with my piece of click text, this will be very helpful.

+4
source share
3 answers

try event.currentTarget.getRepeaterItem() to click instead of showNames

+6
source

Try wrapping your text components in a VBox. As JAX said, there are other issues that you can also consider.

+2
source

Try:

 event.currentTarget.selectedItem.data 

in the click handler.

+1
source

All Articles