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

Apply a phone number filter to an AutoTextEdit field

by Retired ‎02-12-2010 03:17 PM - edited ‎09-16-2010 02:50 PM (1,558 Views)



This article applies to the following:

  • BlackBerry® wireless devices based on Java™
  • BlackBerry Device Software 3.6 and later



If you want to create an AutoTextEdit field that only accepts phone numbers, set the AUTO_CAP style to off (it is set to on by default). This allows proper filtering to occur. The following example demonstrates how to create an AutoTextEdit field in Javadoc™:



AutoTextEditField myField = new AutoTextEditField("AutoTextField: ", "", 100, AutoTextEditField.AUTOCAP_OFF);TextFilter filter = TextFilter.get(TextFilter.PHONE);myField.setFilter(filter);


Note: The AUTO_CAP style is not visible in the Javadocs. It will be made visible in the next release of the Javadocs.

Users Online
Currently online: 22 members 2,122 guests
Please welcome our newest community members: