Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
MichaelDiederich #1
ComboBox select Item
Hi all,
i have a combobox with n entities - and on init i want to select e.g. the
second entity. I tried to use selectedItem, getChildAt and and and.. and it
doesn't work.
Please give me a hint how to get this working!
Thanks,
Michael
MichaelDiederich Guest
-
Select a dataProvider with a ComboBox
When the user makes a selection from a ComboBox (of a list of subjects), how do I tell the dataProvider of the display element that the dataProvider... -
Multiple Item selection in comboBox
Can combo box be used to selected multiple items at a time? -
Unable to retain the selected item in the comboBox usingselectedIndex
Unable to retain the selected item in the comboBox using selectedIndex I have been using two components and the combo in the child component is... -
xml - how to select next item in loop?
Hello, Sorry to crosspost, just didn't know which group was more relevant. I am importing an xml file into my flash and assigning the value... -
how to disable item in combobox
hello, Can any body tell me how to disable item in comboBox. i dont want to disable comboBox, i want only few item of it to be disable in... -
meticoolus #2
Re: ComboBox select Item
I guess, your requirement is to select second element from combo box on page
load .if I am not wrong.
If my anticipation is right then,here i go,
you just have to call the init method in Application tag using initialize or
creationComplete.
like,
<mx:Application ...........initialize= "init();">
(note: if initialize doesnt work use creationComplete = "init() )
//define init method as
<mx:Script>
function init()
{
comboID.selectedIndex=2;
}
</mx:Script>
meticoolus Guest
-
Lu BaoGuo #3
Re: ComboBox select Item
function preSetItemCombox(obj:Object,DefaultItem:String){
var aDP:Array = mx.utils.ArrayUtil.toArray(obj.dataProvider);
var sDataValueInit:String = DefaultItem;
var sDataValueCur:String;
for ( var i:Number=0; i<aDP.length; i++ ) {
sDataValueCur = aDP[i].data;
if ( sDataValueCur == sDataValueInit) {
obj.selectedIndex = i;
}
}
}
Lu BaoGuo Guest



Reply With Quote

