2

I have a strictly numeric field for the user to fill, and the default entry mode to be numeric. In the "Java(TM) Platform Micro Edition SDK 3.0" simulator, the following code is working as it should.

However, on a physical QWERTY keyboard device, such as the Nokia E72, it's not.

The restriction to write only numbers is working. But the default input mode for the field is not. The user has to use the 'Shift' + number in order to input a number, rather than just pressing on a number's key.

The code I'm using is as follows:

    inputField.setConstraint(TextField.NUMERIC); 

    inputField.setInputMode("123"); //I tried commenting this line in case it was
                                              //causing a problem, but it still occurred.
    inputField.setInputModeOrder(new String[]{"123"});

How can I enable a default writing of numbers -without- having to use the native input (T9) screen?

Gabriel
  • 83
  • 1
  • 5

2 Answers2

1

If you use TextArea this will work (since the user will use the native editing only), you can override insertChar() if I remember correctly and just block text input for those devices. I think we fixed this behavior in Codename One.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • I have the same problem with TextArea. Unless the user presses shift+number, the native input screen won't open.. Unfortunately I do not have enough time to transfer the project to a new framework. – Gabriel May 07 '13 at 14:03
  • TextArea doesn't allow input in place for feature phones, this is strictly a feature of TextField. – Shai Almog May 07 '13 at 18:43
0

I think that you can not enable this. Your restriction is to react to interrupt that come from device.Only in case that user interrupt number input the text field will be edited.

Pay attention, Only when you use in T9 the interrupt will be numeric. Therefore when you use without T9, the system recognize this press as Textual input and Lwuit dont edit this input as numeric.

blay
  • 464
  • 9
  • 23