Luchyx:
 
The way I've gotten this to work is as follows
 
selectedIndex="{Utils.ComboBoxSelect(AllPossibleValuesInArrayCollection, 'data', selectedValueFromServer)}"
 
public class Utils
 {
  public static function ComboBoxSelect(ac:ArrayCollection, field:String, value:Number):Number
  {
   for (var i:Number=0; i<ac.length; i++)
   {
    if(ac[i][field] == value)
     return i;
   }
   return 0;
  }
 }
 
Hope that helps

Sam

 
On 10/9/06, luchi_bustos <[EMAIL PROTECTED]> wrote:

Hello list!.
I'm having troubles with a Combobox and selectedIndex.
I'm populating the combobox with an array of categories, that was
returned by AMFPHP service call with this SQL.
/*code SQL
"select id_cat AS data, cat_name AS label FROM users_types ORDER
id_cat ASC";
*/
This return an array of all availables categories and populate the
combobox.
After that I retrieve an especific "user" with and especific
user_level_index value that match the real index in the users_types
database table.
I setting the selectedIndex in the Combobox via.
/*code
userslevelCat_cb.selectedIndex = userfromserver.user_type_index;
*/
The problem is that the selected index is different than the real
index field in the database.
So if I sort te query in a diferent way
the selectedIndex is diferent, and didn't reflect the real category name.

I'm reading some paper's that say if I use an array of {data:#,
label:"cat uno"}, the combo box will try to find the corresponding
value in the "data" property field when I use selectedIndex.

Does anybody here know the problem,has possible solution, or
recomendation?

Thanks in advance.

Luchyx


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to