5 Replies Latest reply on Mar 9, 2010 12:05 PM by Blancocs

    differents id for repeat item?


      is possible to assign differents id or name for the items that the repeater creates?

        • 1. Re: differents id for repeat item?
          Sam Souhrada Level 1

          Rather than IDs for each item you may look at this...




          Search for this topic


          Event handlers in Repeater components

          • 2. Re: differents id for repeat item?
            Blancocs Level 1

            thanks, but i think it's not useful...my problem is this....


            i have a set of images stored in a database. in a moment, i need to get that images and creates differents image control with different id..


            for example, if i have 3 images.






            and then, i will access them with a join of  text "image" and the "ID" of the image.

            • 3. Re: differents id for repeat item?
              Sam Souhrada Level 1

              Here is a more direct link:





              <?xml version="1.0"?>
              <!-- repeater\RepeatersProp.mxml -->
              <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

                    import mx.controls.Alert;
                    public var myArray:Array=[1,2];

                <mx:ArrayCollection id="myAC" source="{myArray}"/>
                <mx:Repeater  id="repeater1" dataProvider="{myAC}">
                  <mx:Repeater  id="repeater2" dataProvider="{myAC}">


              This does it with the labels... You could do the same with the IDs if you chose to.

              Another way to do this is by using event.currentTarget.getRepeaterItem() which hands you the object in the repeater item.

              Everything depends on what your trying to do. What do you want to do with the different image ids?
              • 4. Re: differents id for repeat item?
                Blancocs Level 1

                i have a set of image stored as base64 in a database.

                these images have an ID stored in db.


                i have a tree with differents vehicles that may have differents representative icons (the images store in the database). my idea was.

                loading into a XML the images stored as base64. convert them into an image control with differents id's. and then in the tree set the icon referencing the name of each image control..


                for example, if a vehicle is type 1, the icon will be "image1" variable.

                if a vehicle is type 32, the icon will be "image32" variable.

                • 5. Re: differents id for repeat item?
                  Blancocs Level 1

                  i have load the images and i push them into an array.


                  but i can assign the images to the tree.


                  this is my tree and my xml. dpVehiConEmpresas is the xml.


                  <mx:Tree id="myTree" width="100%" height="100%" labelField="@label"
                                  showRoot="true" dataProvider="{dpVehiConEmpresas.Empresa}" >


                       <Empresa id='37' label='0 La Matanaza'>
                            <vehiculo id='10020031' label='Mat001' veti_id='3'/>
                            <vehiculo id='10020032' label='Mat002' veti_id='3'/>
                       <Empresa id='40' label='0 San Pedro'>
                            <vehiculo id='9182' label='ID creado 9182' veti_id='7'/>
                       <Empresa id='45' label='ALMAFUERTE'>
                            <vehiculo id='10020068' label='TEST 1' veti_id='3'/>
                            <vehiculo id='10020069' label='TEST SMS' veti_id='1'/>


                  to assign a icons, i tried using the iconFunction, i have 2 problems, one is, that i need to compare the attribute veti_id against the array of images.

                  and the iconFunction recives a object, and that object is positioned in Empresa.


                  and the other problem is how i can convert the image to a class. becouse iconFunction must receive a class.