×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    5

    Exclamation How Select an item index without using ItemStateListener.

    hi guys,

    i am trying to determine what is a textfield index number in a form, i tried itemstatelistener and it work but it only work when user keyin some input.

    another way which is using canvas keypress , but it is not working in a form when i try it out.

    so do we have other solution for it , what i trying to do is, when user select the particular textfield it return the index in the form and the form consist of alot textfield. and most important, is that any other way to detect key stroke or is that anyway to keep track which textfield currently i am selecting.

    please let me know if there are similar solution .

    thank you.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: How Select an item index without using ItemStateListener.

    No, there is no "FocusListener", and Forms do not have a keyPressed() event (a Form is not a Canvas).

    What do you want to achieve?

    Graham.

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    5

    Re: How Select an item index without using ItemStateListener.

    hi Graham

    i am trying to keep track user at which item in the form ,

    for example , my form can have 10 textfield , and currently user is highlighting second textfield, i want the to have a value which return the item index of the highlight textfield.

    do you think there is a way can help me to achieve this ?

    thank you

  4. #4
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: How Select an item index without using ItemStateListener.

    As MIDP does not provide us with FocusListener, you can try using LWUIT for this.

    public interface FocusListener
    Observes focus change events for a given form and invokes the callbacks to enable us to assign functionality based on current focused component.


    Method Summary
    void focusGained(Component cmp)
    Invoked when component gains focus
    void focusLost(Component cmp)
    Invoked when component loses focus

    LWUIT - https://lwuit.dev.java.net/

    http://java.sun.com/developer/techni...e/lwuit_intro/
    Thanks,
    Ekta

  5. #5
    Registered User
    Join Date
    May 2010
    Posts
    5

    Re: How Select an item index without using ItemStateListener.

    ektasrv ,

    thx for ur suggestion , i try on it see whether it can work or not.

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: How Select an item index without using ItemStateListener.

    Quote Originally Posted by gengisme View Post
    i am trying to keep track user at which item in the form ,
    Well, yes... I was interested in what you want to achieve from this. Perhaps there is another approach.

Similar Threads

  1. get Selected list item index?
    By deepak59 in forum Symbian
    Replies: 12
    Last Post: 2010-05-12, 09:45
  2. How to list box top item index?
    By datha_k in forum Symbian User Interface
    Replies: 2
    Last Post: 2009-03-26, 17:23
  3. getting wrong Item Index of Grid
    By Nitesh Bhardwaj in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2008-10-03, 08:01
  4. How to get selected index of Item in a Form ?
    By akokchai in forum Mobile Java General
    Replies: 1
    Last Post: 2004-02-23, 01:40
  5. Real item index in a filtered listbox
    By tomutal in forum Symbian User Interface
    Replies: 2
    Last Post: 2003-09-03, 08:34

Posting Permissions

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