Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
Adobe Flex SDK 2.0.1 (Release)
-
None
-
Affected OS(s): All OS Platforms
Affected OS(s): All OS Platforms
Browser: Safari
Language Found: English
Description
Steps to reproduce:
Create a tree object and supply it with an ArrayCollection dataprovider. Add a filter function to the dataprovider that filters out some elements from the list. Call the refresh() method on the dataprovider.
Here's a small application that shows the problem.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
private function doIt() : void
{ _ac.filterFunction = filt; _ac.refresh(); }private function filt( o : Object ) : Boolean
{ return ( o as String ).match( new RegExp( "o", "i" ) ) != null; } [Bindable]
private var _ac : ArrayCollection = new ArrayCollection( [
"one", "two", "three", "four", "five" ] );
]]
>
</mx:Script>
<mx:Button label="do it" click="doIt()"/>
<mx:List width="100" height="200" dataProvider="{_ac}"/>
<mx:Tree width="100" height="200" dataProvider="{_ac}"/>
</mx:Application>
Actual Results:
Tree does not update.
Expected Results:
Tree should update by removing filtered out item.
Workaround (if any):
Reset the tree's dataprovider. E.g. tree.dataProvider = dp