I am facing a strange problem with the combobox in Flex. In the following code :
public function rollCombo(cmb:ComboBox,value:String):void
{
if(value=='') return;
var i:int=0;
cmb.selectedIndex = 0;
var dp1:XMLListCollection = (XMLListCollection(cmb.dataProvider);
trace(value);
while(dp1[i]!=value && i<dp1.length)
cmb.selectedIndex = ++i;
cmb.validateNow();
cmb.validateDisplayList();
trace(cmb.selectedLabel);
}
in an example case, at the end of the execution of the function, i is 7, and cmb.selectedLabel is "xyz"(according to the trace output), but the label displayed in the combobox is a different one.
Also, this is rather unpredictable. It happens sometimes and not always.