Solved

ItemStateListener in List and TextBox

Posted on 2004-08-17
7
501 Views
Last Modified: 2011-09-20
1. How can i detect whether the item is change in a list? E.g. user scroll up and down on the list.

2. How can i detect user is entering some word in the textbox?

thanks
0
Comment
Question by:hawkly
  • 4
  • 3
7 Comments
 
LVL 15

Expert Comment

by:jimmack
ID: 11819996
1) Off the top of my head, I'd say that you can detect the scroll actions on a list, only when a selection is made (ie. changing the state).  This is really more appropriate for a ChoiceGroup rather than a list.

2) You can't use an ItemStateListener on a TextBox, because a TextBox extends Screen, not Item.  You can have an ItemStateListener on a TextField, if that helps.
0
 

Author Comment

by:hawkly
ID: 11826836
>> I'd say that you can detect the scroll actions on a list, only when a selection is made (ie. changing the state).  This is really more appropriate for a ChoiceGroup rather than a list.

is't something like this:
public void commandAction(Command c, Displayable s)
{
      if (c == List.SELECT_COMMAND || c == cmOkOptions)
      {
            switch (myList.getSelectedIndex())
            {
                  case 0:
                        break;
            }
      }
      else if (c == cmBackOptions)
      {
            display.setCurrent(backScreen);
      }
}

>> You can't use an ItemStateListener on a TextBox, because a TextBox extends Screen, not Item.  You can have an ItemStateListener on a TextField, if that helps.

is't possible to have onkeypress event?


Actually what i want to do is when the user is scrolling the list or entering something in the textbox then i will set display.flashBacklight(10000);

so any idea on how to implement this?

thanks
0
 
LVL 15

Expert Comment

by:jimmack
ID: 11828690
The commandAction will only be called when the user activates one of the commands in the list (eg. by pressing the button in the centre of the joypad).  Moving a selection up and down in a list doesn't generate any events that you can capture.

There is no onkeypress event for the high level GUI widgets.  Canvas has keyPressed(), keyRepeated() and keyReleased().

If you're using MIDP-2.0, you could create your own CustomItems.  This should allow you to capure the keyPressed/Repeated/Released events.

0
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 

Author Comment

by:hawkly
ID: 11828813
>> The commandAction will only be called when the user activates one of the commands in the list (eg. by pressing the button in the centre of the joypad).  Moving a selection up and down in a list doesn't generate any events that you can capture.

How can i capture moving a selection up and down in a list ?

thanks
0
 
LVL 15

Expert Comment

by:jimmack
ID: 11828857
AFAIK you can't do this.  It's totally under the control of the operating system/virtual machine implementation.
0
 

Author Comment

by:hawkly
ID: 11828937
I'm interesting on the CustomItems. So where can find the tutorial, API and sample code?

thanks
0
 
LVL 15

Accepted Solution

by:
jimmack earned 125 total points
ID: 11829045
0

Featured Post

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASA Troubleshooting: Easy way to determine an interface's next hop 18 96
Radius Debug Error 16 104
What Accesspoint 7 21
Dlink-DIR 816 router 4 21
This subject  of securing wireless devices conjures up visions of your PC or mobile phone connecting to the Internet through some hotspot at Starbucks. But it is so much more than that. Let’s look at the facts: devices#sthash.eoFY7dic.
This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question