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

RTE in Group during state change

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Adobe Flex SDK 4.0 (Release)
    • None
    • Spark: Group
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      RangeError: Index 0 is out of range.
      at spark.components::Group/checkForRangeError()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\components\Group.as:1106]
      at spark.components::Group/setElementIndex()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\components\Group.as:1265]
      at spark.components::Group/addElementAt()[E:\dev\4.0.0\frameworks\projects\spark\src\spark\components\Group.as:1167]
      at mx.states::AddItems/addItemsToContentHolder()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\states\AddItems.as:737]
      at mx.states::AddItems/apply()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\states\AddItems.as:545]
      at mx.core::UIComponent/applyState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:10042]
      at mx.core::UIComponent/commitCurrentState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9808]
      at mx.core::UIComponent/setCurrentState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9701]
      at mx.core::UIComponent/set currentState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6087]
      at com.pronto.modules.im.view.widget.tree::TreeViewItemRenderer/set listData()[C:\Workspace-3.5.1\Pronto-clean\modules\im\src\com\pronto\modules\im\view\widget\tree\TreeViewItemRenderer.mxml:51]
      at mx.controls::List/makeRowsAndColumns()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\List.as:1417]
      at mx.controls.listClasses::ListBase/scrollVertically()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:7883]
      at mx.controls.listClasses::ListBase/set verticalScrollPosition()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:1695]
      at mx.controls::List/configureScrollBars()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\List.as:984]
      at mx.controls.listClasses::ListBase/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:4394]
      at mx.controls::List/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\List.as:1136]
      at mx.controls::Tree/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\Tree.as:1203]
      at mx.controls.listClasses::ListBase/validateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:3962]
      at mx.managers::LayoutManager/validateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:663]
      at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:736]
      at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1072]

      Group.as, line 1099, checkForRangeError():
      ---------------------------------------------------------------------------
      private function checkForRangeError(index:int, addingElement:Boolean = false):void
      {
      // figure out the maximum allowable index
      var maxIndex:int = (_mxmlContent == null ? -1 : _mxmlContent.length - 1);

      // if adding an element, we allow an extra index at the end
      if (addingElement)
      maxIndex++;

      if (index < 0 || index > maxIndex)
      throw new RangeError(resourceManager.getString("components", "indexOutOfRange", [index]));
      }
      ---------------------------------------------------------------------------

      I've got the following values of variables:
      _mxmlContent = Array (...)
      _mxmlContent.length = 0

      So maxIndex is -1.

      And then I get RTE from this:
      ---------------------------------------------------------------------------
      if (index < 0 || index > maxIndex)
      throw new RangeError(resourceManager.getString("components", "indexOutOfRange", [index]));
      ---------------------------------------------------------------------------

      All this means that somehow "addingElement" is FALSE. It should be TRUE.

      And here is the bug in code, Group.as, addElementAt():
      ---------------------------------------------------------------------------
      public function addElementAt(element:IVisualElement, index:int):IVisualElement
      {
      ...

      // This handles the case where we call addElement on something
      // that already is in the list. Let's just handle it silently
      // and not throw up any errors.
      if (host == this)

      { setElementIndex(element, index); return element; }

      ---------------------------------------------------------------------------

      Example: http://mail.moscow.stalker.com/~maxim/groupBug/GroupRTETest.html
      Steps to reproduce: scroll up and down and select different items. This can take some time.

      Source: http://mail.moscow.stalker.com/~maxim/groupBug/srcview/index.html
      Project FXP: http://mail.moscow.stalker.com/~maxim/groupBug/GroupRTETest.fxp

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: