• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

ChoiceGroup/List +MultipleSelection+Selectin g only true Values

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
What do you have to say for yourself? Hmmm? Anything? And you call yourself a tiny ad.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic