×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    9

    Only numeric input in textfield

    Hi,

    I want to make Textfield in my application that will only take Numeric Input and the Input Mode Order will also be Numeric for these. I am working in LWUIT.

    I have used the following lines of code in my application.

    TextField.setConstraint(TextField.DECIMAL);
    TextField.setInputModeOrder(new String[] {"123"});

    I am using two devices for testing Nokia X3-02 and Nokia Asha 303. On the Nokia X3-02 the Textfield takes only Numeric Input and the Input Mode only remains Numeric. This is exactly what I want to do. On the Nokia Asha 303 the Textfield takes only Numeric Input but it does not set the input mode to numeric.

    I think this is due to the fact that Nokia Asha 303 is a QWERTY device. Please tell me if there is a way to set the Input Mode to Numeric in the Nokia Asha 303.

    Thanks in advance.

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Only numeric input in textfield

    Hi abdul.wahab,

    Please double press the function key in the bottom left corner and try again. Unfortunately the number mode can not be controlled by the application, because LWUIT is an external library. So when you launch an LWUIT application, you get the letter mode by default and you have to manually change to number mode. In native LCDUI components, that are fully supported by the device's Java engine, say a TextField, you can force the number mode as the default one, without having to manually change with the function key.
    Last edited by skalogir; 2012-06-08 at 12:56.

  3. #3
    Registered User
    Join Date
    Mar 2012
    Posts
    9

    Re: Only numeric input in textfield

    Thanks skalogir,

    Pressing the function key two times changes the Input Mode but I want the default Input Mode for the TextField to be Numeric. Is there any way?

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Only numeric input in textfield

    Hi abdul,

    No there isn't, I am sorry. That's because LWUIT is an external library. I have updated the comments on my previous post, regarding this default behavior.

Similar Threads

  1. qml textField as numeric
    By m.azeemanwar in forum Nokia N9
    Replies: 5
    Last Post: 2012-02-11, 03:40
  2. QML how to set textfield as numeric
    By mazeemanwar in forum Nokia N9
    Replies: 5
    Last Post: 2012-01-13, 11:42
  3. Can't switch numeric input to text input in RichTextEditor
    By mobilepig in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-01-03, 05:14
  4. CommandListener on TextField.NUMERIC || TextField.PASSWORD
    By lekkie in forum Mobile Java General
    Replies: 3
    Last Post: 2007-07-09, 13:42
  5. Unfamiliar with Textfield.NUMERIC
    By jaceline in forum Personal Profile
    Replies: 1
    Last Post: 2006-05-18, 07:54

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×