Combobox selected item's index?

Hey people,
i’m making my first steps here and i’d like your help.
Is there a simple way to get/set the the selected item from a combobox by Index?
Something like a
selectedIndex()
/
setSelectedIndex(x)
?

thanks.

Not by index, but item id. Id can be an Integer if you want to. See javadoc for the class.

thanks for the quick respond,
correct me if i’m wrong but if i will use numbers as IDs, then my combobox will present numbers which i don’t want.

You can use setItemCaption(Object itemId, String caption) to define the itemId and the caption to be different.

Make sure that you actually are passing the itemId and not the item when calling this method.

Got it!

thanks.