×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    6

    List item selection

    Hi,

    In my midlet there is a huge EXCLUSIVE list (over 100 items). These items *usualy* are accessed sequentialy. Kind of like chapters in a book.
    When the user selects an item, and exists the midlet, I store the selected item index in a RecordStore.

    When the user runs the midlet again I read in the selected item index from the RecordStore, and issue a setSelectedIndex() method to the list, to set up things as the user had left them before.

    Since the list items are *usualy* accessed sequantialy, I would like the list's cursor to start from the item I just selected. So that the user can easaly select the item after it without scroling all the way down from the head of the list.

    The list object remembers the cursor last position when the midlet is running, but when the user exists the midlet, and then run it again the cursor is positioned at the head of the list.

    One work around is for me to reorder the list so that the head of the list is always the last item selected by the user. But I would rather use a more direct solution.

    So any ideas on how I can manualy set the postion of a list cursor?


    Thanks in advance...

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Helsinki.FI
    Posts
    112
    Hi,

    try commanding:

    setSelectedIndex(YOUR_STORED_INDEX_NUMBER, true);

    in your list, that should do the trick.

    Kind regards,
    Tinke / FN

  3. #3
    Registered User
    Join Date
    Apr 2003
    Posts
    6
    That exactly what I ment when I said :

    "When the user runs the midlet again I read in the selected item index from the RecordStore, and issue a setSelectedIndex() method to the list, to set up things as the user had left them before."

    but may be my english is not that good, sorry

    The command setSelectedIndex() only fills the circle infront of the YOUR_STORED_INDEX_NUMBER item, but it *dose not* move the cursor (the reverse video bar) to the YOUR_STORED_INDEX_NUMBER item.

    I want to control the cursor movment not only make a selection.

    I hope I made it clearer :S

    Thanks again

Posting Permissions

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