Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
johnmiya
Posts: 54
Registered: ‎06-07-2010
My Device: 9780
My Carrier: sw

how to delete itema from objectlist field

Hi..all

 

i m using persistent storage for storing data in objectlists...i insert data...and now iwont to deleteselected data from objectlist...hw to delete selected item 4m objectlist..

plz help me

 

thanks in adv...

 

jaani

Please use plain text.
Developer
filiussoft
Posts: 106
Registered: ‎06-18-2009
My Device: Bold

Re: how to delete itema from objectlist field

I believe your answer includes two things that you need to do.

 

1. Since you said you are storing the data of the ObjectListField, you have to manually maintain your data.  That said, when you remove an item from the ObjectListField, remove it from your data as well and then persist your data again.

 

2. To remove an item from the ObjectListField, use the delete method with the index of the item that you want to remove. such as:

 

 

yourObjectListField.delete(indexOfItemToDelete);

 

 

How are you storing your data? If it is a vector, you can do

 

 

yourVector.removeElementAt(indexOfItemToDelete);

 

 

----
If this helped you, press the thumbs up button (on the far right - '+' thumb icon)
If this post solved the issue, click "Accept as Solution"
Please use plain text.