Get Item Repeater : Repeater « Components « Flex






Get Item Repeater

Get Item Repeater
        

<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->



<!-- repeater\GetItem.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    xmlns:s="library://ns.adobe.com/flex/spark">
    <s:layout>
        <s:VerticalLayout />
    </s:layout>
    <fx:Script>
         
        public function clicker(cName:String):void { 
          foolabel.text=cName; 
        } 
      
    </fx:Script>
    <s:Label id="foolabel" text="foo" />
    <fx:Declarations>
        <fx:Model id="data">
            <color>
                <colorName>Red</colorName>
                <colorName>Yellow</colorName>
                <colorName>Blue</colorName>
            </color>
        </fx:Model>
        <s:ArrayCollection id="myAC" source="{data.colorName}" />
    </fx:Declarations>
    <mx:VBox>
        <mx:Repeater id="myrep" dataProvider="{myAC}">
            <mx:Button click="clicker(event.currentTarget.getRepeaterItem());"
                label="{myrep.currentItem}" />
        </mx:Repeater>
    </mx:VBox>
</s:Application>

   
    
    
    
    
    
    
    
  








Related examples in the same category

1.Repeater with ModelRepeater with Model
2.Current Index in a RepeaterCurrent Index in a Repeater
3.Image source is from RepeaterImage source is from Repeater
4.Hard code data for Repeater providerHard code data for Repeater provider
5.Use Repeater component to create LabelsUse Repeater component to create Labels
6.Provide any data within the array for Repeater componentProvide any data within the array for Repeater component
7.Get Repeater current indexGet Repeater current index
8.Repeater based on Array
9.Get start index for a RepeaterGet start index for a Repeater
10.Set count and start index for RepeaterSet count and start index for Repeater
11.Get repeater itemGet repeater item
12.ArrayCollection as the data source for RepeaterArrayCollection as the data source for Repeater
13.Use Repeater to create buttons from ArrayCollectionUse Repeater to create buttons from ArrayCollection
14.Get data from current repeater itemGet data from current repeater item
15.Reference control created by RepeaterReference control created by Repeater
16.Basic Repeater whose data source is ArrayCollectionBasic Repeater whose data source is ArrayCollection
17.Adding event listener for Button in RepeaterAdding event listener for Button in Repeater
18.Static Loop with RepeaterStatic Loop with Repeater
19.Repeater is inside a MX containerRepeater is inside a MX container
20.How the count and startingIndex properties affect a Repeater componentHow the count and startingIndex properties affect a Repeater component
21.An tag repeats a RadioButton control for each product in an XML file
22.Start from Second Element in Repeater
23.Display URL from Repeater URLDisplay URL from Repeater URL
24.Use repeaters property to display the id value of the Repeater componentsUse repeaters property to display the id value of the Repeater components
25.Repeater control creates all the objects whether or not they are initially visibleRepeater control creates all the objects whether or not they are initially visible
26.Adds a second click handler to call the logAction() method, depending on CheckBox controlAdds a second click handler to call the logAction() method, depending on CheckBox control
27.Register a single listener function (myEventHandler()) to a Button and a CheckBoxRegister a single listener function (myEventHandler()) to a Button and a CheckBox
28.Using the instanceIndices property to set the text property of a TextInput controlUsing the instanceIndices property to set the text property of a TextInput control
29.use the repeaterIndices property instead of the instanceIndices property to set the text property of a TextInputuse the repeaterIndices property instead of the instanceIndices property to set the text property of a TextInput
30.Navigate to a URLNavigate to a URL