My solution (which is not a general one) appears to be avoiding using a binding function with selectedIndex. Rather than:
<mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml" dataProvider="{this.availableOperators}" selectedIndex="{findSelectedIndex(this.selectedOperator, this.availableOperators)}" I have custom custom setters for selectedOperator and availableOperators, and update selectedIndex in those. On Wed, Aug 19, 2009 at 9:34 AM, Richard Rodseth <[email protected]> wrote: > Thanks. I should add that my combobox is in use in an item renderer. A > colleague had a similar problem which went away when he switched to a > repeater. > > It's not clear which if any of your modifications will help my use case, > but I'll try some of them. > > Is there a bug we can vote on besides the one you mentioned (11282) ? It > strikes me that comboboxes in forms must be one of the more common use > cases, and it's pretty disappointing that this component is so problematic. > > > On Tue, Aug 18, 2009 at 9:01 PM, Dmitri Girski <[email protected]> wrote: > >> >> >> This is an old story with ComboBox & selectedIndex. It does not count the >> fact that binding on SelectedIndex could come well before dataProvider >> property assignment, so it simply resets itself every time it has >> dataProvider property being updated. >> I have rewritten the ComboBox class to make it working properly with >> dataProviders. >> >> http://mitek.id.au/blog/2008/10/28/combobox-madness-continues/ >> http://mitek.id.au/blog/2008/08/18/combobox-selecteditem-problem/ >> http://mitek.id.au/blog/2008/06/09/unselect-in-combobox/ >> >> Cheers, >> Dmitri. >> >> >> --- In [email protected] <flexcoders%40yahoogroups.com>, Richard >> Rodseth <rrods...@...> wrote: >> > >> > The full story is too long to relate and involves the component which >> has >> > given me more grief than any other - ComboBox. I'm pretty sure I >> established >> > a while ago that there's a bug in using a ComboBox with a bound value >> for >> > selectedIndex. >> > >> > I have one whose dataprovider (and current selected index) are both >> highly >> > dynamic (changing in response to changes in another combobox). There is >> a >> > circumstance in which the displayed label does not update until you roll >> > over the combobox, or sometimes click on it. Is there a brute force way >> I >> > can make it update? I've tried various invalidateXXX methods. >> > >> >> >> > >

