Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-18746

Exception inside expandItem() when collapsing branch with all items removed since branch opening

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Adobe Flex SDK 3.2 (Release)
    • Fix Version/s: None
    • Component/s: mx: Tree
    • Labels:
      None
    • Environment:
      Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

      Description

      Steps to reproduce:
      Launch the following example and wait 6 sec:
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
      creationComplete="init();">

      <mx:Script>
      <![CDATA[
      import mx.collections.ArrayCollection;

      [Bindable]
      private var dataProvider:ArrayCollection;

      private var folder0:Object;

      private var folder1:Object;

      private var item:Object;

      private function init():void
      {
      dataProvider = new ArrayCollection();
      folder0 =

      { label: "Some folder 0", children: new ArrayCollection() }

      ;
      item =

      { label: "Item" }

      ;
      folder1 =

      { label: "Some folder 1", children: new ArrayCollection([ item ]) }

      ;
      dataProvider.addItem(folder1);

      var timer1:Timer = new Timer(2000, 1);
      timer1.addEventListener(TimerEvent.TIMER, timer1_timerHandler);
      timer1.start();

      var timer2:Timer = new Timer(4000, 1);
      timer2.addEventListener(TimerEvent.TIMER, timer2_timerHandler);
      timer2.start();

      var timer3:Timer = new Timer(6000, 1);
      timer3.addEventListener(TimerEvent.TIMER, timer3_timerHandler);
      timer3.start();
      }

      private function timer1_timerHandler(event:TimerEvent):void

      { tree.expandItem(folder1, true, true, true); }

      private function timer2_timerHandler(event:TimerEvent):void

      { dataProvider.addItemAt(folder0, 0); ArrayCollection(folder1.children).removeItemAt(0); tree.expandItem(folder0, true, true, true); ArrayCollection(folder0.children).addItem(item); }

      private function timer3_timerHandler(event:TimerEvent):void

      { tree.expandItem(folder1, false, true, true); }

      ]]
      >
      </mx:Script>

      <mx:Label text="Just wait 6 sec and you'll see the exception." fontSize="20"
      top="50" horizontalCenter="0"/>

      <mx:Tree dataProvider="

      {dataProvider}

      " id="tree" width="200" height="200"
      horizontalCenter="0" verticalCenter="0"/>

      </mx:Application>

      Actual Results:
      TypeError: Error #1010: Term is undefined and has no properties
      at mx.controls::Tree/expandItem()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\Tree.as:1772]
      at mx.controls::Tree/http://www.adobe.com/2006/flex/mx/internal::expandItemHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\Tree.as:3418]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]
      at mx.controls::Tree/http://www.adobe.com/2006/flex/mx/internal::dispatchTreeEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\Tree.as:3334]
      at mx.controls.treeClasses::TreeItemRenderer/disclosureMouseDownHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\treeClasses\TreeItemRenderer.as:594]

      Expected Results:
      Node collapse without exception

      Workaround (if any):
      Do not use open/close animation, ex. set <mx:Tree openDuration="0"/>

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              adobejira Adobe JIRA
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: