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

Reply
Developer
bb2010
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

Please use plain text.
Developer
simon_hain
Posts: 15,930
Registered: ‎07-29-2008
My Device: Z10 LE
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
Please use plain text.
New Developer
jai1989
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

Please use plain text.
Developer
bb2010
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;    }

Please use plain text.
Developer
simon_hain
Posts: 15,930
Registered: ‎07-29-2008
My Device: Z10 LE
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
Please use plain text.
Developer
bb2010
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



 

 

Please use plain text.