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
Highlighted
Developer
Posts: 154
Registered: ‎01-08-2010
My Device: 8310 Rogers
My Carrier: Vodafone
Accepted Solution

How can we make a text field so that if a user enters a lower case A, we make it an upper case?

HI

 

We have a text field in one of our screens in the blackberry application.

 

We have created the custom text filter so that user can enter only letter 'A' and numbers in the text field. Now we need that if the user enters 'a', we need to change  it to 'A'.

 

How can we do this?

 

Thanks.

 

 

Developer
Posts: 950
Registered: ‎06-22-2010
My Device: 9550

Re: How can we make a text field so that if a user enters a lower case A, we make it an upper case?

U have to write Custom EditField to yr own.

Developer
Posts: 154
Registered: ‎01-08-2010
My Device: 8310 Rogers
My Carrier: Vodafone

Re: How can we make a text field so that if a user enters a lower case A, we make it an upper case?

Hi All

 

I tried the following code and it worked.

 

 

 

public char convert(char character, int status) {
	// TODO Auto-generated method stub
	if (!validate(character)) {
		return 0;
	}
	if (character == 'a') {
		return 'A';
	} else
		return character;
}