Solved

What is repeater?

Posted on 2011-02-21
4
272 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 to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now