Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

What is repeater?

Posted on 2011-02-21
4
Medium Priority
?
297 Views
Last Modified: 2012-05-11
What is repeater and provide me with some sample code?
0
Comment
Question by:naveenm_006
4 Comments
 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 34941030
0
 
LVL 8

Expert Comment

by:jimsweb
ID: 34941031
repeater is nothing but  a loop function in mxml. Suppose you ahve given a dataprovider to repeater, and the repeater can iterate over it and   display the MXML components within the repeater.

I have found a good tutorial on this here. Hope it helps.
http://www.nbilyk.com/flex-repeater-tips
0
 

Accepted Solution

by:
jayasainaths earned 200 total points
ID: 34964329
Hi Naveen,

Repeater is a Class that is used to create multiple instances of a single component depending on the data provided to it...

This is mainly used when the data provider is a dynamically varying XML coming from an external server.

I'm here listing a simple example that well illustrates about the Repeater Class


//CODE

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600" xmlns:local="*">
      
      
      <mx:Script>
            <![CDATA[
                  
                  public function call(str:String):void
                  {
                        l.text = str;
                  }
            ]]>
      </mx:Script>
      
      <mx:ArrayCollection id="arr">
            <mx:String>1</mx:String>
            <mx:String>2</mx:String>
            <mx:String>3</mx:String>
            <mx:String>4</mx:String>
            <mx:String>5</mx:String>
            <mx:String>6</mx:String>
            <mx:String>7</mx:String>
            <mx:String>8</mx:String>
            <mx:String>9</mx:String>
      </mx:ArrayCollection>
      
      <mx:Label id="l" x="716" y="150" fontSize="32" color="White"/>
      <mx:Tile width="200" x="490.5" y="150" height="300">
            <mx:Repeater id="rp"  dataProvider="{arr}">
                  <mx:Button label="{rp.currentItem}" width="50" height="50" click="call(event.target.getRepeaterItem())"/>
            </mx:Repeater>
      </mx:Tile>
</mx:Application>


Please Comment...
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question