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
rgelb1
Posts: 108
Registered: ‎08-05-2008
My Device: Not Specified

How to place a checkbox next to a MenuItem?

I don't see anything in the API docs for MenuItem class to do this...

 

Thanks 

Please use plain text.
Developer
Rajat_10Sep
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: How to place a checkbox next to a MenuItem?

Hi,

 

I think you should make your own menu and do this.

 

Trap the key event for menu press and show your own menu.

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Please use plain text.
Developer
rafo
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: How to place a checkbox next to a MenuItem?

[ Edited ]

There is an easier approach.

 

Use special character symbol from Characters class to display with menu item text.

 

There are two symbols exist: unchecked and checked ballots.

 

In makeMenu() analyze your app data and display relevant (checked or unchecked) symbol at the left side of menu item text.

Message Edited by rafo on 10-05-2009 12:07 PM
----------------
if your issue solved set "Solution" mark at the relevant post
Please use plain text.
Developer
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to place a checkbox next to a MenuItem?

The characters are:

 

Characters.BALLOT_BOX

Characters.BALLOT_BOX_WITH_CHECK

 

Note that the check box becomes part of the text displayed in the menu, it is not a separate Field.  if you want a separately selectable Field, you will have to go with the first approach.

Please use plain text.