This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

ItemCommandListener is not invoked on selection of MessageItem  RSS feed

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

include this lines and try

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

Regards
Gopinath
gopi@c2info.com
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!