If the contents of the list is a string
setting selectedItem should just work. If its an object and you have a ref
to the same object in the CB, setting selectedItem should work.
If you just have matching values youll
probably need to loop, unless the objects in the dataProvider implement IUID
and then you could try to pass an object that has the same uid value as the one
you want to select. That of course is harder to pull off.
Matt
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of John C. Bland II
Sent: Friday, April 28, 2006 11:59
AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re:
mx:ComboBox selectedItem ={blah} (flex 2)
I've already tried that.
Well, not getItemAt because I used items.selectedItem (same thing).
On 4/28/06, Suzy
Lawson
[EMAIL PROTECTED] wrote:
selectedItem={items.getItemAt(3).fieldName}
--- In flexcoders@yahoogroups.com,
John C. Bland II
[EMAIL PROTECTED] wrote:
I am working with some a combo and the custom component
listing the
states
works perfectly fine for simply saying: selectedItem={
items.selectedItem.state}. It will change and work as
expected
(when the
grid is clicked).
Well, that component is nothing but a mx:dataProvider with
mx:String
values inside. So the selectedItem is a string (when calling
mycombo.selectedItem) as opposed to an object.
My question is, when you have an object as the dp to a combo
(or
any other
component with selectedItem) how do you set the selected
item
without doing
a loop + if to find the proper selectedIndex?
Thanks,
--
John C. Bland II
I do what I can do when I can do it. - Chris
Tucker, Money Talks
http://www.gotoandstop.org
- Home of FMUG.az
--
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
Web site design development
Computer software development
Software design and development
Macromedia flex
Software development best practice
YAHOO!
GROUPS LINKS
Visit your group flexcoders
on the web.
To unsubscribe from this group, send an
email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the
Yahoo! Terms
of Service .
--
John C. Bland II
I do what I can do when I can do it. - Chris Tucker, Money Talks
http://www.gotoandstop.org - Home of
FMUG.az
--
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
Web site design development
Computer software development
Software design and development
Macromedia flex
Software development best practice
YAHOO! GROUPS LINKS
Visit your group "flexcoders" on the web.
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.