Welcome!

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.


Reply
Developer
Posts: 157
Registered: ‎03-29-2010
My Device: 8300
My Carrier: bb
Accepted Solution

Context menu Popping up

Hi,

 

My Screen has lots of values to be displayed in the LabelField so i made the screen Scrollable and After each labelField i added a NullField like this 

add(new NullField(NullField.Focusable);

So when the focus comes to this NullField the screen gets scrolled. All this working fine but the problem that i am facing is in OS 6.0 when the focus is on this NullField and when i click on this NullField then ContextMenu Pops up suddenly with the values that i added in the makeMenu(). I want to aviod the ContextMenu to be popped up. 

 

please help..

 

Thanking You

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Context menu Popping up

overwrite navigationclick on the nullfields to return true.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Developer
Posts: 27
Registered: ‎07-27-2011
My Device: curve
My Carrier: vodafone

Re: Context menu Popping up

Hi, just override navigationClick to return true.

protected boolean navigationClick(int status, int time) {

return true;

}

 

or

 

protected boolean touchEvent( TouchEvent event ) {

int eventCode = event.getEvent();

if ( eventCode == TouchEvent.CLICK ) {

return true;

}

}

 

 

Thanks & Regards

Jai

 

_____________________________________________________________________________

 

Feel free to click kudos ... if you find the solution

Developer
Posts: 157
Registered: ‎03-29-2010
My Device: 8300
My Carrier: bb

Re: Context menu Popping up

Hi,i cannot use protected boolean navigationClick(int status, int time) as in the same screen (Class) i am having few icons which i am using as buttons so for the event to generate for the icons i am using the below code
    protected boolean navigationClick(int status, int time)     {      return true;    }

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Context menu Popping up

yes, you can
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
Developer
Posts: 157
Registered: ‎03-29-2010
My Device: 8300
My Carrier: bb

Re: Context menu Popping up

Hi,

 

The issue got fixed what i did was in makeMenu method i just put a if condition as below. if we click the Menu button the instance paramenter is having the value 0 . If we click a diabled button then makeMenu menthod is called and instance paramenter is having the value 65536

 

protected void makeMenu(Menu menu, int instance)    

{        

if( instance == 0)        

{

menu.add(testing);

}

}

 

Thank You Everyone for the help