Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User baihaoping's Avatar
    Join Date
    Feb 2006
    Posts
    45
    I want to focus on a TextField every time I show a Form.Did anyone know how?

  2. #2
    Super Contributor Jason Glass's Avatar
    Join Date
    Mar 2006
    Location
    Phoenix, AZ. USA
    Posts
    556
    should be able to use form.setselected(item) or is it item.setSelected, note, this is only MIDP 2.0
    Jason Glass
    http://IChiBanComputers.Com

  3. #3
    Registered User juarezjunior's Avatar
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,883
    It seems it's not possible to set focus, right?

  4. #4
    Super Contributor Jason Glass's Avatar
    Join Date
    Mar 2006
    Location
    Phoenix, AZ. USA
    Posts
    556
    we were using setselected, which from a MS standpoint, is similar to setfocus

    but had to remove it, or put in preprocessor statements, for doing MIDP 1.0 builds as it was not supported.

    I think it works?
    Jason Glass
    http://IChiBanComputers.Com

  5. #5
    Registered User baihaoping's Avatar
    Join Date
    Feb 2006
    Posts
    45
    Sorry,I don't find a any method similar to setSelected.

  6. #6
    Super Contributor Jason Glass's Avatar
    Join Date
    Mar 2006
    Location
    Phoenix, AZ. USA
    Posts
    556
    you, and juarez are so correct, i am sorry, it is only for a list, i.e. lcdui.list

    there is getselectedindex and setselectedindex methods

    I was going through all this code, and I just kept seeing it 20 plus times, and though it was inherited from lcdui.item

    I apologize

    Anyone know how to implement something similar?
    Jason Glass
    http://IChiBanComputers.Com

  7. #7
    Registered User pervasiveapp's Avatar
    Join Date
    Mar 2006
    Posts
    2
    This is exactly what I wanted to do in a game I'm developing. The user needed to input text into a textfield, so I wanted that field focused as default. You can use the following command to achieve this:

    display.setCurrentItem(item);

    where 'display' is a reference to the midlet diapay and 'item' is the component to focus upon.

    Cheers

  8. #8
    Registered User pervasiveapp's Avatar
    Join Date
    Mar 2006
    Posts
    2
    Something I would like to know, is how to force an form component to retain focus. (ie, so a user cannot press the up/down arrows, changing the focus of a component). I can manage this using a customitem and overriding the traverse method, but can't do this with standard components, such as textfields.

    Or perhaps this is asking a bit much! Any ideas??!

  9. #9
    Super Contributor Jason Glass's Avatar
    Join Date
    Mar 2006
    Location
    Phoenix, AZ. USA
    Posts
    556
    nice pervasiveapp, I though there was a way

    with your dilemma, it sucks their is no lostfocus, focus changed, onchange methods, like there are in other languages
    Jason Glass
    http://IChiBanComputers.Com

Similar Threads

  1. Replies: 4
    Last Post: 2009-02-17, 21:24
  2. Custom item not displayed correctly
    By kakoskin in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2004-10-11, 21:50
  3. Replies: 0
    Last Post: 2004-03-04, 04:39
  4. change focus
    By f_alonso_1 in forum Symbian C++
    Replies: 0
    Last Post: 2003-07-17, 13:34
  5. List item selection
    By SanDan in forum Mobile Java General
    Replies: 2
    Last Post: 2003-05-06, 10:57

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved