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

Adobe AIR Development

Reply
Developer
Posts: 27
Registered: ‎03-27-2011
My Device: Z10,Q10,Z30
My Carrier: Verizon and ATT
Accepted Solution

Dismissing Keyboard after Enter Key is pressed

i have a search box and based on some conditions i am able to set the KeyboardType different.

 

When "Enter" key is pressed, i am able to capture the data from text box

 

private function HandleSearch(evt:KeyboardEvent):void{

if (evt.keyCode == Keyboard.ENTER) {

trace('This is a search = ' + searchBox.text);

}

}

 

Now how i can dismiss/hide the Key Board?

 

I have seen the following code

 

//Show QNX Keyboard

private function showKeyboard():void {

IMFConnection.imfConnection.showInput();

}

//Hide QNX Keybaord

private function hideKeyboard():void {

IMFConnection.imfConnection.hideInput();

}

 

but i am not sure this is the right approach? please let me know if any one has any kind of input regarding this. Thank you very much

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Dismissing Keyboard after Enter Key is pressed

The approach with IMFConnection is undocumented, subject to change, and definitely not advisable for real code, yet.

 

The supported approach is just to set stage.focus to null.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Highlighted
Developer
Posts: 27
Registered: ‎03-27-2011
My Device: Z10,Q10,Z30
My Carrier: Verizon and ATT

Re: Dismissing Keyboard after Enter Key is pressed

Thank you very much for the quick response. I was trying to find different ways, but less resources in internet.. The response was quick and i tried and it worked..