PDA

View Full Version : Setting selection for combo box


blobman
04-11-2006, 06:00 PM
Hello,

I have a combo box, labeled event type.
Options:
Value Text
0
1 Purchase Ringtone
2 Return Ringtone
3 Purchase Video
4 EOM


I gather the data into:
_global.eventtype = eventtype.value;


All my text fields work fine when filling in the retrieved data. But I want the drop downs to stay selected when they come back to that slide.

For example, they fill out the form, then come back to it later, and its still filled out. RIght now I only figured out how to fill out the text fields.

I tried
eventtype.defaultValue = _global.eventtype;
eventtype.default Value = _global.eventtype;
eventtype.selected = _global.eventtype;
eventtype.selectedValue = _global.eventtype;

I tried everything I could think up pretty much.

If any of you know the trick, I would be very appreciative if you shared it with me.

Thanks,
Cameron

blobman
04-11-2006, 06:22 PM
Nevermind, I found it.

I dug through the forums and actually found someone with a similar problem.

instanceNameOfComboBox.setSelectedIndex(number);

Thanks All!
Cameron

tg
04-11-2006, 06:26 PM
to set a selected item in your combo box use:

myComboBox.selectedIndex=2;//sets to 3rd time in dropdown.

tg
04-11-2006, 06:27 PM
heh. just goes to show searching is usually faster than asking.... glad you found it.

blobman
04-12-2006, 01:50 AM
Thanks tg,

actually i was searching for this for the past 2 days, and stumbled across it by chance. Just happened to be right after I posted.