开发者

How to get objective choice field selected index in Blackberry

开发者 https://www.devze.com 2023-03-21 13:02 出处:网络
I have to display items in objective choice Fiel开发者_StackOverflow中文版d,based on selected value i have to display another objective choice field how can i do that.How to get selected index value i

I have to display items in objective choice Fiel开发者_StackOverflow中文版d,based on selected value i have to display another objective choice field how can i do that.How to get selected index value in objective choice field in blackberry.

Thank You


Say you have an ObjectChoiceField myCombo; which have values from an array.

String myValues [] = {"a","b","c"};
myCombo.setChoices(myValues);

you can get the selected index by using method:

int index = myCombo.getSelectedIndex();

and further if you want the selected value. You would use something like:

String selectedValue = myValues[myCombo.getSelectedIndex()];

See documentation for further reference.

0

精彩评论

暂无评论...
验证码 换一张
取 消