03-31-2011 09:05 PM
I am having difficulty deleting an item from a KeywordFilterField. I started with the sample code provided by RIM http://docs.blackberry.com/en/developers/deliverab
When the KeywordFilterField is in search mode, that is when there is something entered in the search field, calling delete(index) on the selected item produces strange results and doesn't delete the currently selected item but rather deletes the last item in the list of filtered results.
Object selected = filterField.getSelectedElement();
if(selected != null){
int selectedIndex = filterField.getSelectedIndex();
filterField.delete(selectedIndex);
}
Does anyone know what is the correct way to delete an item in this case?