BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-08-2007, 11:03 AM   #1 (permalink)
New Member
 
Join Date: Feb 2006
Model: 7520
Carrier: Telus
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Menu Button Click

Please Login to Remove!

Hi all,

A quick, hopefully dumb question: I'm noticing that as I process ButtonField clicks via a FieldChangeListener implementation on an "OK" button designed to clear the screen (i.e. uses popScreen to pop an instance variable of type MainScreen off the stack), that the screen does get popped, but also the "Close" menu comes up as though I'd solely pressed the menu button on its own.

How do I stop that menu from coming up? I.e. when the user clicks the "OK" button, I just want the current screen to come off the stack, have the next screen left on the stack come up, and not have any other menus appear? Thanks!
Offline  
Old 11-08-2007, 12:49 PM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

My guess would be that the FieldChangeListener gets the event at the same time the screen's trackwheelclick method gets it.

One suggestion would be to create a custom class that extends ButtonField and implement trackwheelclick withinit. on "Ok" event, pop your screen, and consume the handle by returning true.
Offline  
Old 11-08-2007, 01:03 PM   #3 (permalink)
New Member
 
Join Date: Feb 2006
Model: 7520
Carrier: Telus
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the response!

Is there any way I can do this without making a custom class? Could I just have the class that contains the buttons implement a TrackWheelListener (or whatever) in addition the FieldChangeListener it already does?
Offline  
Old 11-08-2007, 02:21 PM   #4 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can implement it at the manager or screen level as well. Ultimately you'll have to extend something and create a custom class to do this as the foundation looks to it for implementation.
Offline  
Old 11-08-2007, 03:26 PM   #5 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

ButtonField myButton = new ButtonField("ok", ButtonField.CONSUME_CLICK);
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Offline  
Old 11-09-2007, 12:52 AM   #6 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

yeah, jfisher is right, that will consume the event. it will consume it OK or not though, so if you want to handle those two different events, you'd still have to implement extension
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.