0 Replies Latest reply on Mar 23, 2010 1:44 PM by yruan

    States RemoveChild with Repeater?

    yruan Level 1

      I have a repeater going over an arraycollection and adding in child components

       

      <mx:Repeater id="rp" dataProvider="{dataProvider}">

           <mx:Label id="label1" text="{rp.currentItem.mydata1}"/>

           <mx:Label id="label2" text="{rp.currentItem.mydata2}"/>

      </mx:Repeater>

       

      in my "edit" state, I need to remove the 2nd one.

       

      you can't do this because it complains that label2 is an array and you're trying to coerce it into a displayObject.

      <states>

           <State name="edit">

           <mx:RemoveChild target="{label2}"/>

           </State>
      </states>

       


      since label2 is inside a repeater, it must mean it creates an array of labels all having the id "label2" for as many there are in dataProvider.

       

      so how do i remove all label2's?