Flex Repeater control repeater is not executing "exception

Source: Internet
Author: User

Notes for flex repeater controls

Repeater, as its name implies, means repeat, and repeater is a control used for repetition.

The repeater generates the number of child items based on the number of objects in the data source. All the child items generated are in the form of arrays.

<Mx: repeater id = "myrepeater" dataprovider = "{myarray}">

<Mx: hbox>

<Mx: linkbutton id = "mylabel" label = "{myrepeater. currentitem. name}" Click = "show (event. currenttarget. getrepeateritem ()"/>

<Mx: textinput text = "{myrepeater. currentitem. Age}"/>

</MX: hbox>

</MX: repeater>

There is a common problem:

No. When we call a function and pass the field in repeater as a parameter, the error "Repeater is not executing" cannot be passed.

However, getrepeateritem () is the best solution to this problem.

We don't even need to pass getrepeateritem ()

Pass an event in the past. Use event. currenttarget. getrepeateritem (),

You can also obtain the currentitem of the current object.

We also recommend that you do not use repeater for processing if you can use the DataGrid at ordinary times. Repeater will greatly compromise the efficiency.

We recommend that you go to http://livedocs.adobe.com/flex/3/html/index.html flexflex文 to learn more.

Although the English language is not good, we can understand the code, which is of great benefit to those who learn flex.

<? XML version = "1.0" encoding = "UTF-8"?> <Br/> <mx: Application xmlns: MX = "http://www.adobe.com/2006/mxml" layout = "absolute"> <br/> <mx: SCRIPT> <br/> <! -- [CDATA [<br/> Import MX. messaging. abstractconsumer; <br/> Import MX. collections. arraycollection; <br/> private var my: array = [{name: "A", age: 1 },{ name: "B", age: 2 },{ Name: "C", age: 3}]; <br/> [Bindable] <br/> private var DP: arraycollection = new arraycollection (my ); <br/>] --> <br/> </MX: SCRIPT> <br/> <mx: vbox x = "144" Y = "118" width = "319" Height = "224"> <br/> <mx: repeater id = "RP" dataprovider = "{DP}"> </P> <p> <mx: radiobutton label = "{Rp. currentitem. name} "Click =" aa.text=event.tar get. getrepeateritem (). age "/> </P> <p> </MX: repeater> <br/> <mx: textinput id =" AA "/> <br/> </MX: vbox> <br/> </MX: Application> <br/>

 

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.