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: 60
Registered: ‎08-20-2009
My Device: Not Specified
Accepted Solution

Hide/Show Default Menu and Keyboard?

Hello All,

 

I want to resolve the following requirement. I am developing on 4.7 SDK for Storm device.

 

1. When i click on my application screen(not the Main screen) in BB 9530 Simulator, it automatically pops a menu with "Show Keyboard", "Switch Applicaiton" and "Full menu" items. I don't know why does it showing? I want to not showing this menu when my applicaiton screen launches.

 

I tried using "super(NO_VERTICAL_SCROLL | 262144);" and then

"virtKbd.setVisibility(VirtualKeyboard.HIDE);"

 

but didn't resolve the problem. Does anyone have any idea?

 

2. I have EditField in my application screen. So when i launch that screen, it automatically popping up the keyboard. But i don't want that. I want remove showing the keyboard automatically and should show the keyboard only when user click on the editfield. How do i handle for showing keyboard only when click on EditField and hide the keyboard when user presses "Enter" button.

Note: I'm able to not showing the keyboard automatically during the particular screen launch by using "virtKbd.setVisibility(VirtualKeyboard.HIDE);" in constructor.

 

Could someone give me suggestions?

 

Thanks.

 

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

Re: Hide/Show Default Menu and Keyboard?

1. what do you mean by "click on the screen? "  If you are clicking on some control (like a button), and the click event is not handled, then it will eventually be consumed by the framework and this wil cause the default menu to pop up. You need to be specific about which field is focused when the click occurs, so that you have handle (consume) the click.

 

2. The keybard should only show if an edit field gets the focus when the screen is pushed. Put the focus on a different field.

 

 

Developer
Posts: 60
Registered: ‎08-20-2009
My Device: Not Specified

Re: Hide/Show Default Menu and Keyboard?

1. I'm observing this menu is popping up when launching a screen. By default, focus was in a EditField. So as you have suggested i removed the defualt focus from EditField to a Button. But still I'm observing this menu is popping up when just launching a screen itself.

 

2. Yes. As you said, by default focus was in EditField, That's the reason why it was showing the keyboard when launching screen. I removed focus from EditField to another button control. Now it is just showing keyboard, only when clikcing on  EditField. But i want to also hide the keyboard when "Enter" button tapped from keyboard. So that user can go to the next field and enter the data.

Developer
Posts: 60
Registered: ‎08-20-2009
My Device: Not Specified

Re: Hide/Show Default Menu and Keyboard?

I resolved my problem. I didn't use ButtonField.CONSUME_CLICK for launching a particular screen by clikcing on a button. I changed to ButtonField.CONSUME_CLICK now to launch a screen by clikcing a button, defualt menu is not displayed now.