I have a panel with a ComboBox or even a DropDownList.

The dataprovider is a list which I get from a web service.

I want to have the default item selected.  

However, I do not know the index but the id of the default item and so I
have to look that up.

But by the time the dataList is populated from the webservice, the CB or DDL
is already drawn.

At first, I created a function to lookup the index and return the index and
bound that to the CB  but this didnt work.  Nothing was selected.

ComboBox id="xCB" selectedIndex="{lookupfunction}"

So, I figured the issue was that the data was not loaded yet when the
function was ran.  So I put an event dispatch at the getResults of the
webservice call and then added an eventListener and when the event was fired
telling me that the data was loaded, I then assigned the selectedIndex.  But
again, nothing was selected.   Any Ideas?

protected function colors_colorsResultsHandler(event:ResultsLists):void
{
 colorsCB.selectedIndex = colors.lookupNdxByID(defaultColor);
}




--
View this message in context: 
http://apache-flex-users.2333346.n4.nabble.com/default-Index-for-ComboBox-or-DDL-when-DataProvider-data-comes-from-a-webservice-tp13321.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Reply via email to