Solved

What is repeater?

Posted on 2011-02-21
4
281 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 50 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

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…
Read about why it is more lucrative for an IT company to participate in government projects.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 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