I need help that programmatically sets the selected item to a combo box.
I have a combobox:
<mx:ComboBox id="MyComboBox" change="puzzleHandler(event);" prompt="Make a Selection"> <mx:ArrayCollection id="myDP"> <mx:Object id="first" label="Label 1" series="2" pageTitle="Title 1"/> <mx:Object id="second" label="Label 2" series="7" pageTitle="Title 2"/> <mx:Object id="third" label="Label 3" series="9" pageTitle="Title 3"/> </mx:ArrayCollection> </mx:ComboBox>
I have a function that deals with deep binding. If someone places the URL: www.mysite.com/#view=2, they will be sent to the corresponding part of the site (without choosing Label 2 in comboBox). How to configure comboBox programmatically to match what it is looking at?
In my switch switch statement, I want to set comboBox to a label corresponding to the view. If "view = 2", then the comboBox should display "Label 2" as selected.
case "view=1": MyComboBox.selectedItem.label="Label 1"; parseUrl(); case "view=2": MyComboBox.selectedItem.label="Label 2"; parseUrl(); case "view=3": MyComboBox.selectedItem.label="Label 3"; parseUrl();
I tried this: MyComboBox.selectedItem.label = "Label 1" But it does not work. Any suggestions?
Thanks.
-Laxmidi
flex combobox
Laxmidi
source share