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
Contributor
Posts: 33
Registered: ‎05-12-2010
My Device: none
My Carrier: none
Accepted Solution

Set a field as focusable but not clickable

Hey devs,

 

I am trying to make a field that could be focused but not clicked, I have searched the forum and found different solutions. I finally came up with this:

 

FontField fontField = new FontField(FOCUSABLE | Field.VISUAL_STATE_FOCUS | Field.USE_ALL_WIDTH){

protected boolean navigationClick(int status, int time){
return true;};};

However the menu still pops up when I click on the field. Any clues?


Thanks a lot for your help... Smiley Happy

Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: Set a field as focusable but not clickable

Try overriding navigationUnclick as well.




Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Contributor
Posts: 33
Registered: ‎05-12-2010
My Device: none
My Carrier: none

Re: Set a field as focusable but not clickable

[ Edited ]

Thanks for the fast reply!

 

Here is my new code, which still does not work, is it correctly written at least?

 

FontField fontField = new FontField(FOCUSABLE | Field.VISUAL_STATE_FOCUS | Field.USE_ALL_WIDTH){

protected boolean navigationClick(int status, int time){
return true;};
protected boolean navigationUnClick(int status, int time){
return true;}};

Eclipse does say that "NavigationUnClick" is never read locally, I am not sure of what that means.

Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: Set a field as focusable but not clickable

It is navigationUnclick, not navigationUnClick (notice the difference in capitalization).

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: Set a field as focusable but not clickable

If you're using Eclipse, put @Override in front of every method you (think you) are overriding. Then Eclipse will report an error when you make a typo like that. Smiley Happy




Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Highlighted
Contributor
Posts: 33
Registered: ‎05-12-2010
My Device: none
My Carrier: none

Re: Set a field as focusable but not clickable

It worked, thanks for the tips and solution! Smiley Wink