×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    127

    to delete an item from a list and update it

    Hi,

    I am creating a diary where i can store the text and see it when i want to.
    Now my problem is that when i am trying to delete an item from the choicegroup,exclusive list,i am not being able to do so.
    first when i select the item and click on the delete command the item is deleted but not the selected item,the item is deleted arbitrarily.
    And in the second it is not deleted,bt again in the third time it deletesthe item bt again arbitrarily.

    I know that i am a bit confusing but please i need your help to solve my problem.
    Thanks

  2. #2
    Regular Contributor
    Join Date
    Oct 2007
    Location
    Pune
    Posts
    189

    Re: to delete an item from a list and update it

    Hello,

    You can go here.

    Download the Media:UsingRadioButtons.zip available on the same.

    Nice example for your problem
    Regards,
    Dinanath


    It's a matter of attitude.

  3. #3
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    127

    Re: to delete an item from a list and update it

    Thanks a lot for your reply.
    sorry bt it is not working because i am using record store.
    the list that is displaying here is from record store so it cannot be deleted from list
    i have to delete it from record store.
    my problem with record store is that it deletes first two deletion nicely but at the third time it dont work.
    I am not getting why is it happening so.
    please help me.

  4. #4
    Regular Contributor
    Join Date
    Oct 2007
    Location
    Pune
    Posts
    189

    Re: to delete an item from a list and update it

    Hello,

    is it that record sequence are not matching during deletion?

    Are try to delete selected radio index which is equivalent to record id?

    I guess you need to map list id and record id some how...

    share your code for more understanding....
    Regards,
    Dinanath


    It's a matter of attitude.

  5. #5
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    127

    Re: to delete an item from a list and update it

    Quote Originally Posted by dinanath.d View Post
    Hello,

    is it that record sequence are not matching during deletion?

    Are try to delete selected radio index which is equivalent to record id?

    I guess you need to map list id and record id some how...

    share your code for more understanding....
    Code:
     else if (c == okDelete) {
                System.out.println("DELETE KEY PRESSED");
                           
                int DeleteItemNo = cgTodo2.getSelectedIndex();
            
    					
                String ss=new String(cgTodo2.getString(DeleteItemNo));
                System.out.println("You selected"+ss);
               
                cgTodo2.delete(DeleteItemNo) ;     
                System.out.println("Item number : " + DeleteItemNo);
                
               
                try {
                rs2.deleteRecord(DeleteItemNo+1);//here it deletes ist and 2nd time bt at third time its nt deletedi cud not get why           
              
                // temp = totalRecords2 -1;
                }
                catch (Exception e) {
                }
                         
                //tryied ----
                try{
                RecordStore.deleteRecordStore("doList");
                }
                catch (Exception e) {
                }
    this is a little piece of code
    plz help

  6. #6
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    127

    Re: to delete an item from a list and update it

    please help me with the answer if anyone can...

  7. #7
    Regular Contributor
    Join Date
    Oct 2007
    Location
    Pune
    Posts
    189

    Re: to delete an item from a list and update it

    Hello,,

    Looking at your code...

    You are deleting the record by the index of selected item but not by the record id...

    The selected index will not match every time with record id, as record ids are allocated by the API and are not under your control.

    1. You need to get record id of selected index... you can do this by searching text in record store and get the record id.
    2. Once you the record id then only you can delete that record.

    Once deleted record ids will not be used in record store.
    Regards,
    Dinanath


    It's a matter of attitude.

  8. #8
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    127

    Re: to delete an item from a list and update it

    Thanks.
    i will try it...

Similar Threads

  1. Crash after update ul list items with navigation keys
    By pablopoo in forum Symbian Web Runtime
    Replies: 1
    Last Post: 2009-11-12, 09:43
  2. Help ... my list is drawing strange
    By sudeepa2005 in forum Symbian User Interface
    Replies: 0
    Last Post: 2009-04-06, 06:24
  3. update setting list item...
    By GeKI in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-12-01, 12:24
  4. How to - Dynamically update icons in List or Dialog
    By relliott98 in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-06-13, 14:08
  5. Single listbox item update?
    By mayur_24 in forum Symbian C++
    Replies: 1
    Last Post: 2004-12-03, 01:45

Posting Permissions

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