• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ChoiceGroup/List +MultipleSelection+Selectin g only true Values

 
chanakya khatri
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello;
Can any one tell me how to Display selected items(true) from choice group/List as StringItem or in Textbox.I know if list/choice is implicit/Exclusive this can be done as
StringItem slection= new StringItem(cg.getString(cg.getSelectedIndex()));
but how can i achieve same thing with multiple selection displaying selection in textbox with /n separator. Please help!!
 
Horaci Macias
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at MIDP API, interface Choice:

public int getSelectedFlags(boolean[]�selectedArray_return)
Queries the state of a Choice and returns the state
of all elements in the
boolean array selectedArray_return. NOTE: this is a result parameter.
It must be at least as long as the size
of the Choice as returned by size().
If the array is longer, the extra elements are set to false.

so, I suggest you to try (suposing that your ChoiceGroup/List is named list):

Hope it helps,
Horaci Macias
 
chanakya khatri
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello horaci, Thanks a lot for reply. I got it working I used string buffer for appending result(discussed in java tips May 29, 2001).
Thanks a lot again for you help.
Cheers
Chanakya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic