Hello Tracy, i made exactly this, extended and use this function:

public function setComboItem(combo:String,item:String):void{
 for(var i:Number = 0; i < this[combo].dataProvider.length; i++)
 {
   if(this[combo].dataProvider[i] == item){
     this[combo].selectedIndex = i;
   }                                    
 }
}

But i'm think this is good think to be inside original comp.

--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> Extend combobox yourself, add this functionality, it is not difficult.
> You only need to do it once.  And there are components available that do
> this, I have one that is part of an item renderer, here:
> 
> http://www.cflex.net/showfiledetails.cfm?ChannelID=1&Object=File&objectI
> D=767 It is just an example, not a production level component, the main
> problems are with the renerder part, defining the row-level dataProvider
> for the combo drop down.  Take that out and it gets much simpler.
> 
>  
> 
> One issue with doing it generically is specifying which property of the
> ComboBox dataProvider item to use for the match. You may not be matching
> on the "label". See how I handled it im my example.
> 
>  
> 
> Tracy 
> 
>  
> 
> ________________________________
> 
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of danielvlopes
> Sent: Friday, December 28, 2007 1:32 PM
> To: [email protected]
> Subject: [flexcoders] Sugestion for ComboBox component
> 
>  
> 
> Hello everybody, i want make a sugestion for Adobe Flex Team, and i
> know some members of Flex team participate here, in my projects when i
> use combobox to recover data from database and selected item of this
> combo must be set to the data recorded in database i do loops in
> entire dataprovider to find the value and your index to use
> selectedIndex to receive this index.
> 
> This is very common when you use combo to add and edit data in
> database and i think everybody need this, why adobe don't incorpore
> some new method in next release for do this? Something like
> setSelectedLabe(label:String) ...
>


Reply via email to