I posted this last week and never got a response, so here it is again.
If I can get anyone to agree with my hypothesis, I'll post it as a bug
in the Flex Bug Database.

In a nutshell, the issue is this ... In Flex 2 if you initialized or
set a ComboBox in state ONE, then switched to state TWO (without the
ComboBox), when returning to state ONE the ComboBox would have the
same data values. 

In Flex 3, it seems that the ComboBox gets reset either when entering
state TWO or returning to state ONE.

Here is a small test app that verifies this (or at least I think it does).

Click the "Initialize" button first to set up the ComboBox, then click
the Switch button to switch to state TWO and show the ComboBox. You'll
see it no longer has it's value. While viewing the ComboBox, choose a
different value and the switch back to state ONE then back to state
TWO. The value gets lost.

Here's the test app:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute">
<mx:states>
<mx:State name="show">
<mx:AddChild position="after" relativeTo="{b_show}">
<mx:ComboBox id="cb_freight" dataProvider="{['Gordon','Alex']}"
editable="true" />
</mx:AddChild>
</mx:State>
</mx:states>
<mx:Script>
<![CDATA[
private function switchStates():void{
if(currentState == 'show')
currentState='';
else
currentState='show';
}

private function initIt():void{
currentState='show';
cb_freight.selectedIndex = -1;
cb_freight.text="This is a test";
currentState='';
}
]]>
</mx:Script>
<mx:VBox >
<mx:Button id="b_init" label="Initialize" click="initIt()" />
<mx:Button id="b_show" label="Switch" click="switchStates()" />
</mx:VBox>
</mx:Application>

Reply via email to