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

HierarchicalViewCursor.get current only catches RangeError, but ListCollectionView throws Error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Adobe Flex SDK 3.6 (Release)
    • None
    • Collections
    • None
    • Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Sorry for not attaching example code, but the exact problem can be shown in the source code itself:

      If HierarchicalViewCursor has its childNodes property set to be a ListCollectionView, and its currentChildIndex is -1, then on internal refresh, an error will be thrown that the developer cannot catch.

      Error: Unknown Property: '-1'.
      at mx.collections::ListCollectionView/http://www.adobe.com/2006/actionscript/flash/proxy::getProperty()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:740]
      at mx.controls.treeClasses::HierarchicalViewCursor/get current()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\controls\treeClasses\HierarchicalViewCursor.as:207]
      at mx.controls.treeClasses::HierarchicalViewCursor/collectionChangeHandler()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\controls\treeClasses\HierarchicalViewCursor.as:864]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.controls.treeClasses::HierarchicalCollectionView/nestedCollectionChangeHandler()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\controls\treeClasses\HierarchicalCollectionView.as:696]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.collections::ListCollectionView/dispatchEvent()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:879]
      at mx.collections::ListCollectionView/handlePropertyChangeEvents()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:1248]
      at mx.collections::ListCollectionView/listChangeHandler()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:1120]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.collections::ArrayList/internalDispatchEvent()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\collections\ArrayList.as:528]
      at mx.collections::ArrayList/itemUpdateHandler()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\collections\ArrayList.as:554]

      HierarchicalViewCursor only catches RangeError:
      public function get current():Object
      {
      try
      {
      if (childIndexStack.length == 0)

      { return modelCursor.current; }

      else

      { return childNodes[currentChildIndex]; }

      }
      catch(e:RangeError)
      {
      }
      return null;
      }

      ListCollectionView throws Error if index is -1:
      override flash_proxy function getProperty(name:):
      {
      if (name is QName)
      name = name.localName;

      var index:int = -1;
      try

      { // If caller passed in a number such as 5.5, it will be floored. var n:Number = parseInt(String(name)); if (!isNaN(n)) index = int(n); }

      catch(e:Error) // localName was not a number
      {
      }

      if (index == -1)

      { var message:String = resourceManager.getString( "collections", "unknownProperty", [ name ]); throw new Error(message); }

      else

      { return getItemAt(index); }

      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: