×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    28

    Question deleting a single record

    hi,
    i want to delete a single record..now i have an inbox in my application ...

    [1] now how do i get which record the user has selected ..and how do i retreive the corresponding record from the database ??
    [2] how do i get the record id for a specific record from the database??
    [3] are there specific steps to be followed while deleting such records??

    any suggestion wud be appreciated ..

    regards ,
    dino

  2. #2
    Super Contributor
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: deleting a single record

    Hi,
    will u please explain me that to show different strings(msg according to u)what UI u are using. Canvas,Form or List. If u have use of Canvas then implement a global counter which increases as the user scrolls down and decreases as user moves up. U can easily get the Record from RMS of the value of counter+1 as the recordstore starts from 1. If u have use of form and append the sting or string Item then u cant get the selected record number. If u are using List then can easily get the selected record by getSelectedIndex() function of List. Please clarify ur problem.

    thanks,
    jitu_goldie..
    thanks,
    jitu_goldie..

    KEEP TRYING..

  3. #3
    Registered User
    Join Date
    Jan 2009
    Posts
    28

    Question Re: deleting a single record

    Quote Originally Posted by jitu_goldie View Post
    Hi,
    will u please explain me that to show different strings(msg according to u)what UI u are using. Canvas,Form or List. If u have use of Canvas then implement a global counter which increases as the user scrolls down and decreases as user moves up. U can easily get the Record from RMS of the value of counter+1 as the recordstore starts from 1. If u have use of form and append the sting or string Item then u cant get the selected record number. If u are using List then can easily get the selected record by getSelectedIndex() function of List. Please clarify ur problem.

    thanks,
    jitu_goldie..
    hi,
    i use a list to list the items (i.e.the phone numbers as u see it in ur normal inbox ) an on sel;ecting the items i show a form where u see a form displaying the entire msg..
    now if i use getSelectedIndex() and try and retreive the msg it may not retreive the exact msg properly ..coz the index of the item selected and the record id may not be the same ..so how do i retreive the retreive the msg using the record id and how to get the record id for a particular record..
    so how to solve this problem ..
    (if i m still not clear enuf ..plz tell)

    regards,
    dino
    Last edited by dinoabz; 2009-03-22 at 19:50.

  4. #4
    Super Contributor
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: deleting a single record

    Hi,
    suppose u want to delete third element display on screen then use first

    int record_num = list.getSelectedIndex()////// returns index number of selected element ie 2 in case of selecting third element of list.

    then follow the following steps::

    1. openrecordstore.
    2. copy all the records of recordstore to a vector.
    3. close the opened recordstore.
    4. delete the recordstore.
    5. delete the element from vector like vector.removeElementAt(record_num).
    6. create a new recordstore with the same name as of previous recordstore.
    7. copy all the records from vector to new recordstore.
    8. close the recordstore.

    Note: always close the recordstore when it is not in use. ie just open,use and close the recordstore.

    Please follow the simple steps mentioned above.

    thanks,
    jitu_goldie..
    thanks,
    jitu_goldie..

    KEEP TRYING..

Similar Threads

  1. problem while deleting a record (i'm new 2 j2me)
    By dinoabz in forum Mobile Java General
    Replies: 25
    Last Post: 2012-12-12, 11:50
  2. Record Management Store issue
    By kartikm0021 in forum Mobile Java General
    Replies: 7
    Last Post: 2008-06-10, 16:41
  3. RMS record sizes.
    By earamsey in forum Mobile Java General
    Replies: 1
    Last Post: 2007-10-18, 13:51
  4. Size limit of a single RMS record ?
    By civax in forum Mobile Java General
    Replies: 0
    Last Post: 2005-12-27, 12:55
  5. Deleting a Record (RMS)
    By clv2k2 in forum Mobile Java General
    Replies: 2
    Last Post: 2003-10-03, 13:31

Posting Permissions

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