It's hard when you haven't done it before
:)
Here's what your code should basically look
like:
for (var
i:number=0;i<myComboBox.dataProvider.length;i++) {
if (userObject.companyID ==
myComboBox.dataProvider.getItemAt(i).data) {
myComboBox.selectedIndex = i;
break;
}
}
Shan
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Marlon Moyer Sent: Tuesday, August 08, 2006 7:09 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Fwd: Pre selecting a combo box
I've got a master detail form that works so far except for a combo box
that's giving me fits. The combo box is populated from an xml file that
contains a company id and company name relabeled with the "label" and "data"
headers. The combo box populates correctly and I've verified that it
returns the correct company id. Now, for existing users, I want the combo
box to automatically go to the correct company they're assigned to. The
user object has a company id. I don't believe that I can do it with
binding since it's expecting a selectedIndex vs a selected data value.
I've been experimenting around with trying to loop through the objects in the
combobox, but I haven't had any luck doing so yet.
Is it really this hard? -- Marlon -- Marlon -- -- 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
YAHOO! GROUPS LINKS
__,_._,___ -- |
- [flexcoders] Fwd: Pre selecting a combo box Marlon Moyer
- RE: [flexcoders] Fwd: Pre selecting a combo box Shannon Hicks
- Re: [flexcoders] Fwd: Pre selecting a combo box Marlon Moyer