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.
精彩评论