If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
almeida
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified
Accepted Solution

VirtualKeyboard and Fields

On Storm, should the virtual keyboard appear automatically when a text entry field is focused?  Should the virtual keyboard disappear if some other field is focused?

 

I have a MainScreen with a BasicEditField and an ObjectChoiceField.  If the BasicEditField is the first field on the screen, the virtual keyboard gets displayed when the screen gets pushed on the stack.  If I focus the ObjectChoiceField, the virtual keyboard remains on the screen.

 

If the ObjectChoiceField is first, the virtual keyboard is not displayed when the screen is pushed.  If I focus the BasicEditField, the virtual keyboard does not appear.  I have to choose Show Keyboard from the menu to see it.

 

Shouldn't the virtual keyboard appear automatically based on the field?  If not, what is the right work around?  Do I really have to decide whether each of my fields needs a keyboard and then show and hide it in onFocus?

 

This is 4.7.0.148 on a Storm 9530.

 

Thanks. 

Please use plain text.
Administrator
MSohm
Posts: 14,362
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: VirtualKeyboard and Fields

How are you changing focus?  Is the user selecting the new field or are you programmatically switching focus between fields?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
almeida
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified

Re: VirtualKeyboard and Fields

Hi Mark.  The user is selecting the new field.  I have not tried programmatically switching focus.
Please use plain text.
Administrator
MSohm
Posts: 14,362
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: VirtualKeyboard and Fields

The virtual keyboard should be shown automatically.  I have been able to reproduce this and have sent the issue to our development team.  Thanks for reporting this!

 

To work around the issue you can manually display the virtual keyboard.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
almeida
Posts: 91
Registered: ‎02-04-2009
My Device: Not Specified

Re: VirtualKeyboard and Fields

Thanks Mark.  For the curious, here is my workaround for a field that needs the keyboard:

 

protected void onFocus(final int direction) {

getScreen().getVirtualKeyboard().setVisibility(VirtualKeyboard.SHOW_FORCE);

super.onFocus(direction);

}

 

I use HIDE_FORCE for fields that do not need the keyboard.  It works well for me. 

Please use plain text.