I have two comboboxes using data gathered from a httpService call. One with region and one with teams from that region. So that when you change the region you get a new list of teams. Seems simple enoughWhen it loads initially I get the proper results. When I change the area the first time I get the proper results, except the combobox size shrinks up to only show two of the results. When I change the area again I see the first team in the display of the combobox until I click on the drop down and it still shows the old results. If I click one of the old results, it then shows the new list. I have torn this part of my design down and completely rebuilt it a half dozen times, and I get the same results every time.I am using this example as a guide...http://blog.flexexamples.com/2007/08/04/creating-two-related-comboboxes/. //Here is my code
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="loadAreas()">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import com.model.Model;
public function loadAreas():void{
var ac:ArrayCollection = new ArrayCollection();
for each(var area:Object in Model.instance.vehicleAC){
ac.addItem({name: area.name, children: area.children});
}
areaCB.dataProvider = ac;
}
private function areaChange():void{
teamCB.dataProvider = null;
teamCB.dataProvider = areaCB.selectedItem.children;
}
]]>
</mx:Script>
<mx:ComboBox id="areaCB" labelField="name" change="areaChange()"/>
<mx:ComboBox id="teamCB" dataProvider="{areaCB.selectedItem.children}" labelField="Team"/>
</mx:HBox>