Reputation: 1606
I have EditField. I want to show virtual keyboard only with number, without letters. Is it possible?
Upvotes: 1
Views: 1229
Reputation: 5095
You can either construct the EditField and pass EditField.FILTER_NUMERIC
as the style: http://www.blackberry.com/developers/docs/7.0.0api/net/rim/device/api/ui/component/BasicEditField.html#FILTER_NUMERIC
OR
You can call EditField.setFilter()
http://www.blackberry.com/developers/docs/7.0.0api/net/rim/device/api/ui/component/BasicEditField.html#setFilter(net.rim.device.api.ui.text.TextFilter) and pass in aTextFilter
. Use the static TextFilter.get()
function and pass in one of the filter constants from the TextFilter
class, eg http://www.blackberry.com/developers/docs/7.0.0api/net/rim/device/api/ui/text/TextFilter.html#NUMERIC
Numeric filters accept non-negative integers only (0 - 999999999 and beyond), Integer filter accepts all integers negative, zero and positive, and REAL_NUMERIC accepts any decimal number (negative, zero, positive, with an optional decimal point).
Upvotes: 0
Reputation: 241
amount->setInputMode(bb::cascades::TextFieldInputMode::NumbersAndPunctuation);
You can find all the types here: https://developer.blackberry.com/cascades/reference/bb__cascades__textfieldinputmode.html
Upvotes: 0