Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Feb 2013
    Posts
    41

    LWUIT TextArea - edit on focus for non-touch devices?

    Hi All,

    I am trying to create an entry form with a bunch of TextAreas on it. When I set the focus on one of the TextArea (e.g. by pressing the navigational key down), I want the state of the TextArea to be in edit mode immediately with the cursor appearing on the TextArea as opposed to the default behavior of having the user to press the MSK first before going into edit mode. Also, when I press down, I want the changes that I made to the TextArea be committed automatically and then move the focus to the next component. Is there a setting that I can set in order to accomplish this or does all of these need to be done manually?

    Thanks!
    Jim

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

    Re: LWUIT TextArea - edit on focus for non-touch devices?

    Hi Jim,

    There isn't any existing method that you can use in order to achieve this. The down key, in a TextArea is reserved for moving the cursor between the lines (since a TextArea can have multiple lines).
    If however your field is meant for single line input, you can use the TextField, which from a quick test on Nokia Slide 6260, behaves according to your requirements.

  3. #3
    Registered User
    Join Date
    Feb 2013
    Posts
    41

    Re: LWUIT TextArea - edit on focus for non-touch devices?

    Thank you for your reply. Yes, I did see this behavior in the S40 6th Edition emulator which is a 6260 slide for single-line Textfields. However, this behavior is not the same when I run it on a C3-00 which is a QWERTY device where it would require the user to press the MSK first before getting the opportunity to input text. Do you have any idea why this is the case?

    One interesting observation that I noticed was that if I used Nokia's LWUIT library, then I get the behavior that I was describing. However, if I use Oracle's LWUIT (1.5) library, I do not get that behavior on C3-00.
    Last edited by lordbritishix1982; 2013-04-17 at 22:45.

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

    Re: LWUIT TextArea - edit on focus for non-touch devices?

    You are welcome. LWUIT for Series 40 is customized to take into consideration, when possible, the Nokia UI API that is not part of Oracle's standard Java ME (or LWUIT) offering. The interesting thing is that support for the Nokia UI API varies from one Series 40 device to another. In your case, the TextField implementation in LWUIT for Series 40 is actually a custom rendering of a TextEditor, which is a Nokia UI API component. When using the TextEditor one needs to use the MSK to enable editing. Nokia C3-00 supports the TextEditor class and therefore by default when you instantiate a TextField, what you actually get under the hood is a TextEditor. Nokia 6260 slide, does not support the TextEditor class, so the implementation falls back to the default LWUIT TextField.

    The good news is that you can force LWUIT for Series 40 not to use native Series 40 components for the rendering of the TextField component with this line:

    Code:
    TextField field = new TextField("");
    field.setUseNativeTextInput(false);
    Then you can use the down key to focus and start typing immediately.

  5. #5
    Registered User
    Join Date
    Feb 2013
    Posts
    41

    Re: LWUIT TextArea - edit on focus for non-touch devices?

    Oh, I didn't know it behaved that way - that's good to know. I did try out your suggestion but I did not like how it behaved. Inputting of the text is really slow, the cursor does not show up upon focus, and the menu bar's MSK would still show Edit upon Text box focus. It kind of feels that it was not meant to be switched that way

    Anyway, I feel that the TextEditor implementation for non-touch devices should not require the user to press the MSK as it makes text input slower. The alarm clock application that's built-in with the phone (probably uses LCDUI) demonstrates my desired behavior for text input for non-touch devices - but oh well.

    Thank you!

  6. #6
    Registered User
    Join Date
    Jan 2009
    Location
    Melbourne, Australia
    Posts
    2,571

    Re: LWUIT TextArea - edit on focus for non-touch devices?

    Nice question. FYI, this was featured this week. Is there a wiki article that can be captured from this, or not enough to say?

  7. #7
    Registered User
    Join Date
    Mar 2013
    Location
    United Kingdom
    Posts
    161

    Re: LWUIT TextArea - edit on focus for non-touch devices?

    Congratulations lordbritishix1982!

  8. #8
    Registered User
    Join Date
    Feb 2013
    Posts
    41

    Re: LWUIT TextArea - edit on focus for non-touch devices?

    Woot! Thanks! I am not sure if there is a wiki describing this behavior but maybe this behavior is something that you can add on future Nokia LWUIT doc releases in order to avoid confusion.

Similar Threads

  1. Replies: 2
    Last Post: 2012-11-23, 08:39
  2. LWUIT TextArea Problem
    By zzwei in forum Mobile Java General
    Replies: 4
    Last Post: 2012-09-20, 10:12
  3. How to reduce the Font of a text from LWUIT TextArea
    By pavanragi in forum Mobile Java General
    Replies: 7
    Last Post: 2012-08-17, 10:06
  4. [moved] LWUIT Textarea with multilines
    By kenthan in forum Mobile Java General
    Replies: 2
    Last Post: 2012-06-21, 11:00
  5. Replies: 3
    Last Post: 2011-07-19, 07:50

Posting Permissions

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