07-29-2010 06:55 PM
hi
i have one class for customTextBox which uses editfield.and one class is for customtextfilter.
how can i set EmailtextFilter in customTextfilter class for Customtextbox.
thankx
07-29-2010 11:17 PM
CustomTextFilter extends EmailTextFilter!!!!
07-30-2010 05:25 PM
hi bb_dude
public TextBoxField(int width, int height)
{
super(Manager.NO_VERTICAL_SCROLL);
managerWidth = width;
managerHeight = height;
font=fontfamily[0].getFont(FontFamily.CBTF_FONT,16 ).derive(Font.PLAIN);
editField = new EditField(Field.FIELD_VCENTER)
{
public void paint(Graphics g)
{
g.translate(0, 1);
getManager().invalidate();
super.paint(g);
}
public void layout(int width,int height)
{
managerWidth=width;
managerHeight=height;
super.layout(width, height);
setExtent(width, height);
}
};above code snippet is of my custom class which i am using for textfield.
_textbox[20]=new TextBoxField(118,28); row[20].add(_textbox[20]);
i am using it from other class like above.
now if i use class as u told i have two problems.
1.For each field i have to make a new class to set filter for each.
2.there is no default value set for eachfield.
i tried your suggestion for email but it gives illegalargument exception.
because before the entering values for email field it checks and get the null value.and thats why gives exception.
Finally.
how i can make one class for validation which comprises all types of validations according to my textfield class.
07-30-2010 10:52 PM
Let me get this straight.
Are you trying to validate an email address entered in a text field?