Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 237
Registered: ‎05-07-2010
My Device: 8520
My Carrier: Internet

how can i set textfilter in customTextfilter class?

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

___________________________________________________
please press kudos(star button on left) if this post is helpful to you
"Accept as solution" if your query has been resolved.@hitendra
_________________________________________________
Developer
Posts: 516
Registered: ‎07-23-2010
My Device: 9900

Re: how can i set textfilter in customTextfilter class?

CustomTextFilter extends EmailTextFilter!!!!

Developer
Posts: 237
Registered: ‎05-07-2010
My Device: 8520
My Carrier: Internet

Re: how can i set textfilter in customTextfilter class?

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.

___________________________________________________
please press kudos(star button on left) if this post is helpful to you
"Accept as solution" if your query has been resolved.@hitendra
_________________________________________________
Developer
Posts: 516
Registered: ‎07-23-2010
My Device: 9900

Re: how can i set textfilter in customTextfilter class?

Let me get this straight.

Are you trying to validate an email address entered in a text field?