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
Posts: 39
Registered: ‎03-20-2009
My Device: Not Specified

Disable menu and button

Hi,

 

I am new to the BlackBerry development. I just want to know that whether it is possible to make menu and buttonfield disable and make then enable based on some condition by keeping them added. I know the alternative to remove it and add it based on condition but I want to make them enable and disable rather than adding and removing.

 

Please help me.

 

Regards,

Roney

Developer
Posts: 432
Registered: ‎02-23-2009
My Device: Not Specified

Re: Disable menu and button

You can disable the menu by overriding makeMenu() but there is no way to toggle between enabling and disabling the Menu and Buttonfield. You have to add and remove on the basis of condition as you said.

 


Press the kudos button to thank the user who helped you.

If your problem was get solved then please mark the thread as "Accepted solution".

 

 

 

 

 

Deepesh Gupta
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Disable menu and button

You have to invent it. We have our own custom button class with a disable() method.

 

This method sets a property which disables the click events and repaints the image with a 60% alpha value.

 

Highlighted
New Developer
Posts: 4
Registered: ‎11-20-2009
My Device: Not Specified

Re: Disable menu and button

If possible, can you provide the code of your custom button field?