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
Contributor
Posts: 42
Registered: ‎08-30-2012
My Device: PlayBook
My Carrier: Aircel
Accepted Solution

My KeyBoard actionlistener event is not working correctly

Hi everyOne,

 

In my app iam generating the output while the user is typing the data in text input field, for that iam adding actionlistener to keyboard,

the problem is i did nt get the data while typing i need to wait for some time or need to press enter or esp keys

 

wts the prbelm can any one tell me. here is my code

searchInput.prompt = "Search...";		searchInput.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);

private function keyDownHandler(event : KeyboardEvent) : void{
dao.getDatabyKeyword(searchInput.text,onSuccessfullyRetrived);
}
//here getdatabykeyword is my database method and on succesfullyretrived is display data method 
no problems with these two methods i tested those.

 

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: My KeyBoard actionlistener event is not working correctly

Try listening to Event.CHANGE, instead of the keyboard event for the text input control. Standard TextInput responds to text changes. This assumes that the QNX TextInput was implemented this way and you are using that control.

If you add a trace(...) to your callback function, are you saying that it is not being triggered with key down events?
Contributor
Posts: 42
Registered: ‎08-30-2012
My Device: PlayBook
My Carrier: Aircel

Re: My KeyBoard actionlistener event is not working correctly

Thank you very much sir,
event.change is working according to my need
thanks a lot