1 Reply Latest reply on Jul 22, 2009 2:03 PM by Paul Reilly

    Is it possible to place repeater in Accordion header?

    ggwtg

      Hi All,

       

      In the accordion header   i need to place image and label .I will get the label text   from xml file.Each row header contains single label.So is it possible to place the repeater in accordion header.

       

      code:

      --------

      <mx:HTTPService id="myhttp" url="sample.xml"  resultFormat="e4x" />

       

       

        <mx:Accordion>
                     <mx:headerRenderer>
                          
                             <mx:Component>
            
        
            <mx:Repeater id="myRep" dataProvider="{myRep.lastResult.number}" >
        
          <mx:Canvas x="64.5" y="132"   width="333" >
               
          <mx:Image source="@Embed(source='Imagestest.png')" id="img1" width="20" height="17" x="10" y="10"/>
          <mx:Label text="{myRep.currentItem.name}" id="lbl" fontSize="14" color="#483F3F" x="29" y="10" width="166"/>
         
               
          </mx:Canvas>

       

          </mx:Repeater>
        </mx:Component>
        </mx:headerRenderer>
        <mx:Label text="sample" />

                </mx:Accordion>

       

       

       

      Thanking you.

        • 1. Re: Is it possible to place repeater in Accordion header?
          Paul Reilly Level 1

          Try putting the Repeater inside the Accordion:

           

            <mx:Accordion>

           

              <mx:Repeater id="myRep" dataProvider="{myRep.lastResult.number}" >
            
              <mx:Canvas x="64.5" y="132"   width="333" >
                   
              <mx:Image source="@Embed(source='Imagestest.png')" id="img1" width="20" height="17" x="10" y="10"/>
              <mx:Label text="{myRep.currentItem.name}" id="lbl" fontSize="14" color="#483F3F" x="29" y="10" width="166"/>
             
              </mx:Canvas>

           

              </mx:Repeater>

           

            </mx:Accordion>

           

          I'm not sure if it will work.  If not, move the canvas into a custom component and use AS3 to iterate over the data and add a component instance to the Accordion in each iteration.