Flex repeater multi-layer nesting

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.