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

ArrayCollection.removeAll throws error if bound to sorted DataGrid

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Adobe Flex SDK 2.0 (Release)
    • Collections
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Reproduction:
      1. Run the code below
      2. Click Update several times (should be ok)
      3. Sort the Count column of the grid
      4. Click Update

      Actual Results:

      RangeError: Index '2' specified is out of bounds
      at mx.collections::ListCollectionView/removeItemAt()
      at mx.collections::ListCollectionView/removeAll()
      at sortme/$internal::update()
      at sortme/___Button4_click()

      =========================================

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*">

      <mx:Script>
      <![CDATA[

      import mx.collections.ArrayCollection;

      [Bindable]
      var data:ArrayCollection = new ArrayCollection();

      function update() {
      var r:Object =

      {one: 1, two: 2, three: 3}

      ;
      data.removeAll();
      for (var k:String in r) {
      data.addItem(

      {key: k, value: r[k]}

      );
      }
      }
      ]]
      >
      </mx:Script>

      <mx:Canvas width="100%" height="100%">

      <mx:Panel x="34" y="29" height="534" width="740" title="Sort and Update Test">
      <mx:Canvas height="100%" width="100%">
      <mx:Button x="299" y="41" label="Update" click="update()"/>

      <mx:DataGrid dataProvider="

      {data}

      " width="100%" x="1" y="116" height="217">
      <mx:columns>
      <mx:DataGridColumn columnName="key" headerText="Event"/>
      <mx:DataGridColumn columnName="value" headerText="Count"/>
      </mx:columns>
      </mx:DataGrid>

      </mx:Canvas>
      </mx:Panel>

      </mx:Canvas>
      </mx:Application>

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: