1 Reply Latest reply on Jul 2, 2009 12:35 AM by seb foucault

    Unbound ItemRenderer

    seb foucault

      Hello,

       

      Is there a safe way to be notified that an item renderer used to render items in a tiled list (either horizontal or vertical list) is not used anymore (for instance when switching from a state in which the data provider contains one or more items to a state in which the data provider does not contain any item).

       

      Using Flex 3.0.x, I noticed that none of the following approaches works :

      • Intercepting the dataChange event - This event is not called when a previously bound item renderer is no longer used
      • Intercepting the flex.event.Event.REMOVE event - This event seems not to be called when the item renderer is removed from its parent
      • Intercepting the flash.event.Event.REMOVED event of the item renderer parent. Same. Not called.

       

      Any idea ?

       

      Thanks in advance - Regards

      --

      sébastien foucault

        • 1. Re: Unbound ItemRenderer
          seb foucault Level 1

          I finally found a workaround consisting in intercepting the call to visible = false made by ListBase.addToFreeItemRenderers.

          It is not bullet proof but may help in some situations :

           

          public override function set visible( value: Boolean ): void {

             super.visible = value;

             if ( value == false ) {

                // doSomething

             }

          }

           

          --

          sébastien