Create a variable to hold the current selection index
private var comboCurrentSelectedIndex:int = -1;
add a change event to the comboBox
mx:ComboBox id=myComboBox change=myComboBoxChanged()/
keep the selected index current
private function myComboBoxChanged():void
{
Thanks for your reply.
But I guess setting selectedIndex would not work, as it is quite
possible for an extra item to be added in the data and hence the text
that was selected might now be 4th instead of 3rd.
I think I might have to use selectedlabel and store it and then
compare that text value
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of nehavyas13
Sent: Monday, October 27, 2008 12:36 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Combo box changes selected Item when dp
refreshes
Thanks for your reply.
But I guess
Yes, I was going to do it with selectedLabel and selectedItem but you
specifically talked about the index so I thought that was what you wanted.
--- In flexcoders@yahoogroups.com, nehavyas13 [EMAIL PROTECTED] wrote:
Thanks for your reply.
But I guess setting selectedIndex would not work, as
--- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote:
Yes this is standard behavior. ComboBox has no way of knowing whether
the currently selected item exists in the new dataProvider.
It knows, as setter could simply loop through the dataProvider and
check the fact of
5 matches
Mail list logo