1 Reply Latest reply on Feb 21, 2011 3:39 PM by Shongrunden

    Foo extends ListBase bug !!! Serious !!!

    gurkerl83

      hi, listbase changed in sdk build 19786,

      19786 + post like not released 20135 which is included in the prerelease flashbuilder

      override protected function partAdded(partName:String, instance:Object):void
          {
              super.partAdded(partName, instance);

       

              if (instance == dataGroup)
              {
                  // Not your typical delegation, see 'set useVirtualLayout'
                  if (_useVirtualLayout && dataGroup.layout && dataGroup.layout.virtualLayoutSupported)
                      dataGroup.layout.useVirtualLayout = true;
                 
                  dataGroup.addEventListener(
                      RendererExistenceEvent.RENDERER_ADD, dataGroup_rendererAddHandler);
                  dataGroup.addEventListener(
                      RendererExistenceEvent.RENDERER_REMOVE, dataGroup_rendererRemoveHandler);
              }
          }

       

      so, on  RendererExistenceEvent.RENDERER_ADD and REMOVE the handler functions are called.

      Previously to that version eg. in

      there is no internal handling when a item is added to the datagroup.

      pre 19786

      override protected function partAdded(partName:String, instance:Object):void
          {
              super.partAdded(partName, instance);

       

              if (instance == dataGroup)
              {
                  // Not your typical delegation, see 'set useVirtualLayout'
                  if (_useVirtualLayout && dataGroup.layout)
                      dataGroup.layout.useVirtualLayout = true;
              }
          }

       

      !!!!!!!!!!!!!!

      Some libs exists eg. the expander Toolkit or a Flex 4 Tabbar http://examples.flashdan.net/blog/posts/Flex%204%20TabBar/srcview/inde x.html

      that  rely on the RendererExistenceEvent.RENDERER_ADD,  RendererExistenceEvent.RENDERER_REMOVE Event to trigger a different  behaviour.

      In the above tabbar CustomTabBar Class which extends TabBar extends TabbarBase extends ListBase;  the following partAdded method is included:

      It runs greate in pre versions of sdk 19786 but breaks completly in 19786!!!

      !!!!!!

       

      Custom tabbar part added:

       

      protected override function partAdded(partName:String, instance:Object):void {
                  super.partAdded(partName, instance);
                 
                  if(instance == dataGroup){
                      dataGroup.addEventListener(RendererExistenceEvent.RENDERER_ADD, dataGroup_rendererAddHandler);
                      dataGroup.addEventListener(RendererExistenceEvent.RENDERER_REMOVE, dataGroup_rendererRemoveHandler);
                      dataGroup.addEventListener(CustomTabBarCloseEvent.CLOSE_TAB, closeHandler);
                  }
              }