BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-11-2010, 06:20 PM   #1 (permalink)
New Member
 
Join Date: Apr 2010
Model: 9000
PIN: N/A
Carrier: bold
Posts: 9
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Refreshing ListField Items

Please Login to Remove!

Hello every one...



I have created a screen which uses a listfield to display the contents of a persistent vector object.

Now when I remove the element from that list.. It does fine to remove the element from persistent vector but from list it always removes the last element of the list... and when I go back (popping this screen) and again come to this screen the list shows up as it should be(with the selected element removed).



I Have tried all poss. ways like deleting and adding the list again.... etc... please suggest a way out...



Here's the relevant code.. of the ListScreen...



Please Help!!





final class ListScreen extends MainScreen {

ListField myListLS = new ListField();
ListCallback myCallbackLS = new ListCallback();


public ListScreen(ListField myListbl,ListCallback myCallbackbl) {
super();

LabelField title = new LabelField("List",
LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
setTitle(title);
myListLS=myListbl;
myCallbackLS = myCallbackbl;
myListLS.setCallback(myCallbackLS);
add(myListLS);
addMenuItem(addnum);
addMenuItem(remove);

}

public MenuItem addnum = new MenuItem("Add Number", 110, 10)
{
public void run()
{
UiApplication.getUiApplication().popScreen(UiAppli cation.getUiApplication().getActiveScreen());
UiApplication.getUiApplication().pushScreen(new AddScreen());
}
};
public MenuItem remove = new MenuItem("Remove", 110, 10)
{
public void run()
{
int i = myListLS.getSelectedIndex();
SmsHide._poData.removeElementAt(i);

synchronized (SmsHide.store)
{

SmsHide.store.setContents(SmsHide._poData);
SmsHide.store.commit();
}


Dialog.inform("Number Removed!! Press OK to Add a new number");
myListLS.delete(i);
}
};
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Original SanDisk 64MB CompactFlash Industrial CF memory card SDCFJ 04 SDCFB 03
$8.97
Original SanDisk 64MB CompactFlash Industrial CF memory card SDCFJ 04 SDCFB 03 pictureAllen-Bradley 1756-L55/A-M13 CPU Module SER A F/W 1.2 M13/A 1.5 BYTES MEMORY
$125.0
Allen-Bradley 1756-L55/A-M13 CPU Module SER A F/W 1.2 M13/A 1.5 BYTES MEMORY pictureSchneider/Telemecanique PLC SRAM Memory Card TSXMRPC448K New In Box
$439.0
Schneider/Telemecanique PLC SRAM Memory Card TSXMRPC448K New In Box  picturet. Cute Memory Cartoon Notepad Memo Diary Notebook Book Best Gift Note Pads 1PC
$0.5
t. Cute Memory Cartoon Notepad Memo Diary Notebook Book Best Gift Note Pads 1PC pictureBI RA BIRA SYSTEMS MODEL 5302 ADC PGA-MEMORY CAMAC PLUG IN
$50.0
BI RA BIRA SYSTEMS MODEL 5302 ADC PGA-MEMORY CAMAC PLUG IN picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.