×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    29

    How to get the highlighted item in ChoiceGroup.MULTIPLE

    I have a rather simple question I cannot find an answer to.

    I have a ChoiceGroup with MULTIPLE flag:

    ChoiceGroup list = new ChoiceGroup (null, Choice.MULTIPLE); // this is basically a check listbox

    I want to know which item is currently highlighted (selected) in the GUI.

    list.getSelectedIndex() is always returning -1 with Choice.MULTIPLE (and this is how it behaves according to documentation: http://java.sun.com/javame/reference...SelectedIndex()).

    Is there any way to get which item in the list is highlighted in this case? I am looking not for a checked item (with Choice.MILTIPLE there could be many items checked) but the one which is highlighted by the user (there should be always only one, or none).

    Any help is appreciated.

  2. #2
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    106

    Re: How to get the highlighted item in ChoiceGroup.MULTIPLE

    Is far as I am concerned there is no way to achieve what you want.
    Last edited by Unit1ed; 2009-08-03 at 03:13.

  3. #3
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    387

    Re: How to get the highlighted item in ChoiceGroup.MULTIPLE

    hi, one can not get highlighted item untill select button is pressed, but if you are seriously concern about it, make a choice group in lowlevel, and via keypress you could detect
    Thanks and Regards,
    Manjul.

  4. #4
    Nokia Developer Champion
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: How to get the highlighted item in ChoiceGroup.MULTIPLE

    Quote Originally Posted by Yuriy View Post
    I have a rather simple question I cannot find an answer to.

    I have a ChoiceGroup with MULTIPLE flag:

    ChoiceGroup list = new ChoiceGroup (null, Choice.MULTIPLE); // this is basically a check listbox

    I want to know which item is currently highlighted (selected) in the GUI.

    list.getSelectedIndex() is always returning -1 with Choice.MULTIPLE (and this is how it behaves according to documentation: http://java.sun.com/javame/reference...SelectedIndex()).

    Is there any way to get which item in the list is highlighted in this case? I am looking not for a checked item (with Choice.MILTIPLE there could be many items checked) but the one which is highlighted by the user (there should be always only one, or none).

    Any help is appreciated.
    In case of Multiple type of choicegroup u cant do the same. Just see wtk documentation. Ur all doubts will be cleared.
    thanks,
    jitu_goldie..

    KEEP TRYING..

  5. #5
    Registered User
    Join Date
    Dec 2007
    Posts
    29

    Re: How to get the highlighted item in ChoiceGroup.MULTIPLE

    Quote Originally Posted by manjul_saini View Post
    hi, one can not get highlighted item untill select button is pressed, but if you are seriously concern about it, make a choice group in lowlevel, and via keypress you could detect
    What do you mean by making choice group "in low level"? Implement a CustomItem or something? I need more specifics.

  6. #6
    Regular Contributor
    Join Date
    May 2008
    Location
    Kochi,Kerala,India
    Posts
    105

    Re: How to get the highlighted item in ChoiceGroup.MULTIPLE

    yes you can implement a choice group as a custom item.
    on up and down key press just take the index of the choice group list.
    for more understanding read these articles.
    Custom GUI development with MIDP 2.0
    Custom List item with marquee effect
    Be hungry,Be foolish
    vivart pandey

Similar Threads

  1. Replies: 3
    Last Post: 2011-06-24, 08:02
  2. how can i find the highlighted item in a multiple list?
    By xarris_ in forum Mobile Java General
    Replies: 3
    Last Post: 2007-06-16, 17:40
  3. how to get the position of a cascaded item in a menu?
    By GeKI in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-05-18, 15:47
  4. Keep track of highlighted ITEM on form
    By ymtoh in forum Mobile Java General
    Replies: 1
    Last Post: 2005-12-28, 00:36
  5. 9210 and CEikTextListBox highlighted item colour
    By jraninen in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-05-07, 07:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •