5 Replies Latest reply on Feb 9, 2011 2:50 AM by Flex Rock

    Loading controls in Repeater

    Flex Rock Level 1

      Hi,

              I have a repeater in which i have Label and HRule. The length of dataprovider is 4. So label and Hrule appears four times. But i need the Hrule to be appeared only three times.

       

      example.

       

      I need the layout to be like this.

      Layout.jpg

       

      Regards,

      Jayagopal.

        • 1. Re: Loading controls in Repeater
          BhaskerChari Level 4

          Hi Jayagopal,

           

          Try this code..

           

          <?xml version="1.0"?>
          <!-- charts/UsingBarSets.mxml -->
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
            <mx:Script><![CDATA[
               import mx.collections.ArrayCollection;

               [Bindable]
               private var _dataProvider:ArrayCollection = new ArrayCollection([
                           {label:"Video Quality Optimized (recommended)"},
                           {label:"480p (High)"},
                           {label:"360p (Med)"},
                           {label:"288p (Low)"}
               ]);

              

            ]]></mx:Script>

          <mx:VBox verticalGap="0" width="300" backgroundColor="#000000">
            <mx:Repeater id="rptComp" dataProvider="{_dataProvider}" recycleChildren="true">
             <mx:Label text="{rptComp.currentItem.label}" color="white" fontSize="13" />
             <mx:HRule width="100%" strokeColor="white" visible="{rptComp.currentIndex != _dataProvider.length-1}" includeInLayout="{rptComp.currentIndex != _dataProvider.length-1}" />
            </mx:Repeater>
          </mx:VBox>

          </mx:Application>

           

          Thanks,

          Bhasker Chari

           

          Message was edited by: BhaskerChari

          • 2. Re: Loading controls in Repeater
            Flex Rock Level 1

            Thanks Bhasker, this is what i am expecting.

             

            thanks,

            Jayagopal.

            • 3. Re: Loading controls in Repeater
              Flex Rock Level 1

              Hi Bhasker,

                                   I need another one thing. I need to set the selected value that is the default selected value.

               

              thanks,

              Jayagopal.

              • 4. Re: Loading controls in Repeater
                BhaskerChari Level 4

                @Jayagopal,

                 

                Where do you want the selected value..??

                 

                There is no such a property for Repeater comp..Can you please elaborate your question..??

                 

                Thanks,

                Bhasker

                • 5. Re: Loading controls in Repeater
                  Flex Rock Level 1

                  Hi Bhasker,

                                       Refer the image. I need to higlight the same way it was highlighted in the image.

                   

                   

                  thanks,

                  Jayagopal.