Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

Posts: 51
Registered: ‎11-27-2008
My Device: Not Specified
Accepted Solution

Blackberry Storm / Buttons Click not working ... (opens Menu)



im writing a little app for the Storm.


If i click a button in the app, the Storm just opens the Blackberry Menu (Simulator with 9000 works fine)

What am i doing wrong here ?



FieldChangeListener Flistener = new FieldChangeListener() { public void fieldChanged(Field field, int context) { ButtonField button = (ButtonField) field; /*check which button...*/ if (button.getLabel() =="create Playlist"){ UiApplication.getUiApplication().pushScreen(new PlaylistScreen()); } } };



/*Display Buttons for create...*/ ButtonField createButton = new ButtonField("create Playlist", ButtonField.FIELD_HCENTER); createButton.setChangeListener(Flistener); add(createButton);





BlackBerry Development Advisor
Posts: 15,887
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Blackberry Storm / Buttons Click not working ... (opens Menu)

Is your FieldChangedListener firing?  Note that you can override the navigationClick method of ButtonField to capture when a user clicks on the button.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Blackberry Storm / Buttons Click not working ... (opens Menu)



Another issue that you should be aware of is that the touch events are delegated from screen to manager to field. You can easily break this chain in an override in your screen or manager.


Make sure that you are properly re-delegating the events (that you do not consume) in any overrides of touchEvent(), navigationClick(), etc.


I've had several situations where we were inadvertantly "eating" a UI event and causing similar issues.



Posts: 51
Registered: ‎11-27-2008
My Device: Not Specified

Re: Blackberry Storm / Buttons Click not working ... (opens Menu)

oh, sry totally forgot this post ...


Well i managed to solve this problem, the Solution was, that i had to add the





property to the Style of the Button Field, like this:


ButtonField Button1 = new ButtonField("Button that consumes Click",ButtonField.CONSUME_Click); add(Button1);


thx for your answers anyway.