Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor jselvakumar26071988's Avatar
    Join Date
    Sep 2008
    Posts
    158
    i have form with 3 choice group(say country(with options as india,us),gender(m,f),qualification(B.E,B.com))
    prob is i want to retrieve in text box as choice group name(ie country,gender,qualification)
    i hope the func is form.get(int itemnum)
    but how to get itemnum....
    thanks in advance

  2. #2
    Nokia Developer Moderator bogdan.galiceanu's Avatar
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471
    You can use ChoiceGroup.getSelectedIndex() to get the index of the chosen element and then use
    ChoiceGroup.getString(int elementNum) to get the actual string. Something like this:
    Code:
    ChoiceGroup country=new ChoiceGroup("Select country", ChoiceGroup.EXCLUSIVE, new String[] {"India", "US", "Greece"}, null);
    int index=country.getSelectedIndex();
    String selectedCountry=country.getString(index);
    Last edited by bogdan.galiceanu; 2008-09-27 at 19:28. Reason: Fixed typo in code

  3. #3
    Regular Contributor jselvakumar26071988's Avatar
    Join Date
    Sep 2008
    Posts
    158
    i dont want to get country name(ie india or usa for the selected one)rather i need the word "country" which is the one of the choicegroup name...ie the element name in the form not the selected name in the list.....
    is dat clear....

  4. #4
    Nokia Developer Moderator bogdan.galiceanu's Avatar
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471
    Then use Form.get(int itemNum), where itemNum is the index of the ChoiceGroup in the form, to get the ChoiceGroup item and call its getLabel() method to get its title:
    Code:
    Form form=new Form("");
    //Append the necessary ChoiceGroup instances
    form.get(1).getLabel(); //This returns the title of the second ChoiceGroup instance
    Is that what you meant?

  5. #5
    Regular Contributor jselvakumar26071988's Avatar
    Join Date
    Sep 2008
    Posts
    158
    dats where prob is....i want to get the choicegroup no manually by user out of the 5 choicegroup i have.....if the user selects the first choicegroup(ie country)then it should display country
    or if user selects (qualification)then it should display qualification...if u know the answer plz explain with a prog

Similar Threads

  1. Form Menu Problem
    By kumar_sai123 in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-09-03, 04:46
  2. Problem MMC+USB Connection
    By Fede81 in forum Symbian C++
    Replies: 1
    Last Post: 2007-06-14, 06:13
  3. Problem with commands
    By antonio5982 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2007-04-30, 08:09
  4. Problem MMC+USB Connection
    By Fede81 in forum General Development Questions
    Replies: 3
    Last Post: 2006-07-19, 15:21
  5. Problem in Displaying the Form
    By pratbrat77 in forum Symbian C++
    Replies: 0
    Last Post: 2003-12-10, 21:09

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved