wood burning stoves 2.0*
The moose likes Java Micro Edition and the fly likes ItemCommandListener is not invoked on selection of MessageItem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "ItemCommandListener is not invoked on selection of MessageItem" Watch "ItemCommandListener is not invoked on selection of MessageItem" New topic
Author

ItemCommandListener is not invoked on selection of MessageItem

carox kaur
Ranch Hand

Joined: Mar 19, 2009
Posts: 52
I am using de.enough.polish.ui.MessageItem class in my application. I want to trap the event on selection of this item. In my application, I have many instances of MessageItems (like a list) appended to the form and I want to show an Alert (along with the text of the MessageItem) when user selects a MessageItem. What I am doing is:

The above code is just the overview of what I am doing. I am trying to capture the event by using javax.microedition.lcdui.ItemCommandListener but the event is not been trapped. By using CommandListener, although I am able to show the Alert but I am not able to get the reference of the MessageItem which is selected by the user.
Can anyone help me in event handling on MessageItem. I will be really thankful.

Gopinath Karyadath
Ranch Hand

Joined: Oct 14, 2009
Posts: 87
Hi Friend

your trying display your form . so please try this instead of

((( Msg.setItemCommandListener(this); ))


Form.setItemCommandListener(this);

Regards
gopi@c2info.com
carox kaur
Ranch Hand

Joined: Mar 19, 2009
Posts: 52
Registration of ItemCommandListener is applicable on Items (MessageItem) and not to the form. Form class do not have method "setItemCommandListener()".
Below is the complete code which is no working. I have no idea why on clicking the MessageItem, Alert is not been shown.
Gopinath Karyadath
Ranch Hand

Joined: Oct 14, 2009
Posts: 87
hi

include this lines and try

msg.setDefaultCommand(Select) ;
msg1.setDefaultCommand(Select) ;

Regards
Gopinath
gopi@c2info.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ItemCommandListener is not invoked on selection of MessageItem
 
Similar Threads
calculate the amount values stored form recordstore in J2ME midlet
failing to get login right from servlet and midlet
Please check this code !!!!
Network error in first Servletjava.lang.NullPointerException in java wireless toolkit
Applet -Servlet connection in JNLP