×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    2

    Problem with ListBox and deleting ListBoxItems

    Hello

    This is my first post and I hope I can explain myself correctly

    I am using Carbide Pro, an evaluation version, and I am working with ListBox using the functions of adding and removing elements from it using as a guide the example of the "shopping list"

    It works correctly unless the property of Markable List of the ListBox is modified

    In that case, Items can still be added to the ListBox, buif it is tried to remove one of them, I receive a Panic; E32USER-CBase 21

    The line that has problems and the one used to remove items is this one:
    ((*CDesCArray) Model->ItemTextArray())->Delete()

    Just like using another which is very similar:
    model->SetItemTextArray()

    But I have checked the index of the ListBox and it is between the limits of the used array

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,570

    Re: Problem with ListBox and deleting ListBoxItems

    You may find something in Listbox example of 2nd edition S60 SDK-s. It contains markable list (although I do not know if it removes elements from it).

  3. #3
    Registered User
    Join Date
    Jul 2007
    Posts
    2

    Re: Problem with ListBox and deleting ListBoxItems

    I have been doing some test with new Projects, changing the Markable List Option
    But I could not make any progress
    I only could notice that the function:
    DeleteSelectedListBoxItemsL( CEikTextListBox* aListBox )
    which is auto-generated by Carbide, has the same error

    I hope that this server you, so somebody can find a way to fix it

  4. #4
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: Problem with ListBox and deleting ListBoxItems

    it might help to check the SDK docs: "This panic is raised by any operation which accesses an element of an array by explicit reference to an index number, for example, the Delete(), InsertL() and At() member functions or the operator Operator[]. It is caused by specifying an index value which is either negative or is greater than or equal to the number of objects currently within the array."

    So have a look into your index values and that they are on the range, also remember that the indexing starts with zero, thus the last one is Count() - 1.

    yucca

Similar Threads

  1. Deleting an open FindBox crashes app
    By inc0gn1t007 in forum Symbian
    Replies: 4
    Last Post: 2006-11-03, 13:38
  2. ListBox icon array
    By Gingah in forum Symbian User Interface
    Replies: 9
    Last Post: 2004-10-14, 11:37
  3. How to delete the last item in a listbox
    By zhang_guoqing in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-07-21, 07:28
  4. Deleting last element from ListBox
    By santhosh_uk in forum Mobile Java General
    Replies: 0
    Last Post: 2003-06-06, 09:57
  5. Icon in column listbox does not appear
    By khanming in forum Symbian User Interface
    Replies: 1
    Last Post: 2002-06-26, 12:46

Posting Permissions

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