Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there somebody who can help me?

 
Salvatore La Placa
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If not, at least answer me that is impossible to do such a thing in j2me.(They are 4 days that I'm waiting an answer...)Thank you.
I display all records(contacts of an addressbook) of a recordStore in a List.This addressbook contains 3 fields:first name,last name,telephone.How can I delete a contact from this addressbook?How can I pass the parameter recordId to the method deleteRecord of RMS?
This is the List which display all records:
private Screen genNameScr(String title,
String f,
String l,
boolean local) {
SimpleComparator sc;
SimpleFilter sf = null;
RecordEnumeration re;
phoneNums = null;
if (local) {
sc = new SimpleComparator(sortOrder == 0 ?
SimpleComparator.SORT_BY_FIRST_NAME :
SimpleComparator.SORT_BY_LAST_NAME);
if (f != null || l != null) {
sf = new SimpleFilter(f, l);
}
try {
re = addrBook.enumerateRecords(sf, sc, false);
} catch (Exception e) {
displayAlert(ERROR,
"Could not create enumeration: " + e, null);
return null;
}
} else {
re = new NetworkQuery(f,l, sortOrder);
}
nameScr = null;
if (re.hasNextElement()) {
nameScr = new List(title, List.IMPLICIT);
nameScr.addCommand(cmdBack);
nameScr.addCommand(cmdDial);
nameScr.addCommand(cmdModify);
nameScr.addCommand(cmdDelete);
nameScr.setCommandListener(this);
phoneNums = new Vector(6);
try {
while (re.hasNextElement()) {
byte[] b = re.nextRecord();
String pn = SimpleRecord.getPhoneNum(b);
nameScr.append(SimpleRecord.getFirstName(b) +
" " + SimpleRecord.getLastName(b) +
" " + SimpleRecord.getPhoneNum(b), null);
phoneNums.addElement(pn);
}
} catch (Exception e) {
displayAlert(ERROR,
"Error while building name list: " + e, null);
return null;
}
display.setCurrent(nameScr);
} else {
displayAlert(INFO, "Nessun contatto presente in Rubrica", null);
}
return nameScr;
}

Thank you again for your answer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic