I want a BasicEditField that lets me enter alphabets only...and a combination of upper case and lower case ...as in Jan, Feb...when i use the upper case and lower case filter that are there in BaiscEditField it allows either the entire string to be in upper case or lowr case ..not a combination..how do i achiever this...?
+1
A:
Richard's right, extend TextFilter, UPDATE according to Marc's suggestion:
class AlphaTextFilter extends TextFilter {
public char convert(char c, int status) {
if (!validate(c))
return 0;
return c;
}
public boolean validate(char c) {
return CharacterUtilities.isLetter(c);
}
}
Then simply use
BasicEditField.setFilter(new SimpleTextFilter());
See also BlackBerry Support Community Forums:Java Development:Input Text Validation
Max Gontar
2009-12-19 07:18:20
will this filter work when the program is run on a device with some other language....i mean will the char's be mapped automatically..if not please let me know how to make this localized...
Kaddy
2010-01-06 21:23:54