flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From OK <p...@olafkrueger.net>
Subject Re: default Index for ComboBox or DDL when DataProvider data comes from a webservice
Date Wed, 17 Aug 2016 07:24:02 GMT
CodeGirl wrote
> 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?

Maybe the data is received successfully from your service but the
dataProvider of the ComboBox is not populated at the time you try to set the
selectedIndex.
You could try to populate the dataProvider 'manually' after receiving the
data from your service and set the selectedIndex afterwards. 

protected function myResultHandler(event:ResultEvent):void
{
    colorsCB.dataprovider = event.my.data.object;
    colorsCB.selectedIndex = colors.lookupNdxByID(defaultColor);
}

Olaf




--
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-tp13321p13327.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Mime
View raw message