Questions about multiple nested repeater controls
Multi-dataset nesting allows you to directly query multiple datasets of controls with the same name by using the control ID.
However, the data set is fixed. If there are exceptions, you cannot access this method.
<? XML version = "1.0" encoding = "UTF-8"?>
<Mx: Application xmlns: MX = "http://www.adobe.com/2006/mxml" layout = "vertical">
<Mx: SCRIPT>
<! [CDATA [
[Bindable]
Public var temparray: array = [1, 2, 3]
Public Function btn_click (): void
{
// Trace (BTN [2] [2] [2]);
Trace (BTN );
}
]>
</MX: SCRIPT>
<Mx: repeater id = "R1" dataprovider = "{temparray}">
<Mx: repeater id = "R2" dataprovider = "{temparray}">
<Mx: repeater id = "R3" dataprovider = "{temparray}" Count = "{r2.currentindex + 1}">
<Mx: button id = "BTN" Click = "btn_click ()"/>
</MX: repeater>
</MX: repeater>
</MX: repeater>
</MX: Application>
Result
, Repeater0.btn [0] [1] [0], repeater0.btn [0] [1] [1], BTN [0] [2] [2], repeater0.btn [0] [2] [0], repeater0.btn [0] [2] [1], repeater0.btn [0] [2] [2], repeater0.btn [1] [1] [0], repeater0.btn [1] [1] [1], BTN [1] [2] [2], repeater0.btn [1] [2] [0], repeater0.btn [1] [2] [1], repeater0.btn [1] [2] [2], repeater0.btn [2] [0] [0], repeater0.btn [2] [1] [0], repeater0.btn [2] [1] [1], repeater0.btn [2] [2] [0], repeater0.btn [2] [2] [1], repeater0.btn [2] [2] [2]
BTN [0] [0] BTN [1] [0] BTN [2] [0] the error code returned by ID verification is invalid.