Re: [flexcoders] FB2B3 programmatically select an item in a ComboBox

2006-05-16 Thread jeremy lu
: Monday, May 15, 2006 7:01 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] FB2B3 programmatically select an item in a ComboBox glad that helped. adding var itm:* = cboCountry.dataProvider.getItemAt(i) might be a little bit efficient. On 5/16/06, Steve Gustafson [EMAIL

RE: [flexcoders] FB2B3 programmatically select an item in a ComboBox

2006-05-16 Thread Gordon Smith
; break; } } - Gordon From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jeremy lu Sent: Tuesday, May 16, 2006 3:00 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] FB2B3 programmatically select an item in a ComboBox hi Gordon, that's interesting

[flexcoders] FB2B3 programmatically select an item in a ComboBox

2006-05-15 Thread Steve Gustafson
Greetings and thanks in advance for your help!I have a ComboBox that displays a countries. The label is a country Name The data is a country codeI then retrieve a users record via AMF. Standard stuff with First Name, Last Name etc. I am populating various fields with the retrieved data, which

Re: [flexcoders] FB2B3 programmatically select an item in a ComboBox

2006-05-15 Thread Simeon Bateman
Well I dont know exactly what is wrong, but using flex builder it would be pretty easy to set a break point on the if line of code and then step through the loop to ensure that those to variables are what you think they should be. I use a mac and so my solution is to just use an alert to pop up

Re: [flexcoders] FB2B3 programmatically select an item in a ComboBox

2006-05-15 Thread jeremy lu
well, I believe all the getItemAt() methods are removed from List-base components like Combobox, List, DataGrid in F2B3. to do the loop correctly, try this: for(var i:Number = 0; i cboCountry.dataProvider.length; i++) { var itm:* = cboCountry.dataProvider.getItemAt(i); if( itm.data ==

Re: [flexcoders] FB2B3 programmatically select an item in a ComboBox

2006-05-15 Thread Steve Gustafson
That solved it! The key is using the dataProvider.length instead of the ComboBox .lengthI shortened the code block a little to:for(var i:Number = 0; i cboCountry.dataProvider.length; i++){ if (cboCountry.dataProvider.getItemAt(i).data == event.result.COUNTRY) { cboCountry.selectedIndex = i;

Re: [flexcoders] FB2B3 programmatically select an item in a ComboBox

2006-05-15 Thread jeremy lu
glad that helped. adding var itm:* = cboCountry.dataProvider.getItemAt(i) might be a little bit efficient. On 5/16/06, Steve Gustafson [EMAIL PROTECTED] wrote: That solved it! The key is using the dataProvider.length instead of the ComboBox .lengthI shortened the code block a little

RE: [flexcoders] FB2B3 programmatically select an item in a ComboBox

2006-05-15 Thread Gordon Smith
To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] FB2B3 programmatically select an item in a ComboBox glad that helped. adding var itm:* = cboCountry.dataProvider.getItemAt(i) might be a little bit efficient. On 5/16/06, Steve Gustafson [EMAIL PROTECTED] wrote: That solved