Solved

What is repeater?

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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…
An article on effective troubleshooting
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

803 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