I've got a Spark DropDownList (I'm on Flex SDK 4.0, Flash Builder 4).
That DropDownList has an ArrayCollection as its dataProvider property, and in response to user gestures, I change the filterFunction on the ArrayCollection (and call ArrayCollection.refresh()) to update the list of items in the DropDownList. This works fine.
However, what I wasn't expecting was that neither my change event handler, nor my valueCommit event handler gets called when the selected item in the DropDownList changes due to the filterFunction filtering out items from the ArrayCollection.
In other words, let's say I have items A, B, and C in ArrayCollection (and thus, also as items in my DropDownList). Item A is currently selected, but I then set the ArrayCollection.filterFunction to something, and call ArrayCollection.refresh(). Items A and B are filtered out by the filterFunction, and it disappears from the DropDownList, causing item C (the next available item after A and B) to be selected. But, even though the selected item has changed, neither my change handler nor my valueCommit handler get called.
I know the handlers are working, because the change handler gets called when the user selects a new item from the DropDownList, and the valueCommit handler gets called when the selectedIndex is changed programmatically in code, as expected.
Is this a known issue? Is there an event I can listen to so I can know when the selected item has changed in this circumstance?
Post a 20-line test case. Some changes were put in just before 4.0 shipped.
You're not on a beta version are you?
I'm not on a beta. I'll try post a short test case as soon as I am able, but I'm in the final week before a major project deadline and as a result I've got to stay pretty focused on that :-)
I'm using the Flex 4.0 SDK that shipped with Flash Builder 4.