Help coderanch get a
new server
by contributing to the fundraiser
  • 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

getSelectedIndex() question

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good evening. I had a question as to why I am getting this error:

I wanted to list a series of choices for the user, by using the ChoiceGroup() method. But, when I try to access their choice (from the array that I provided), I get this error.
Also, I'm having some trouble understanding how to set a variable to their response. For instance, I have this right now...
ChoiceGroup siteChoice = new ChoiceGroup("Choose a Site", List.EXCLUSIVE, cells, null);
siteScreen.append(siteChoice);
So can I access which selection they decided on? Thank-you very much for any help you could provide! Happy Father's Day!
[ edited to preserve formatting -ds ]
[ June 17, 2002: Message edited by: Dirk Schreckmann ]
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you should use the getSelectedIndex()-Method with an object. or is it inside this class?
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good evening. I had a question as to why I am getting this error
You are getting that error, because the method, getSelectedIndex, does not exist in the context that you are trying to use it.
by using the ChoiceGroup() method
Is that maybe not a method but a constructor?
Who is this they that you refer to?
ChoiceGroup is not a class in the standard API, so I don't know anything about it.
 
Jason Long
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ahh, I figured out what I did wrong. Wow, I'm not that smart. Thank-you very much for your help. It is greatly appreciated!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic