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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
New Developer
pc
Posts: 16
Registered: ‎08-03-2009
Accepted Solution

Key events on fields in custom horizontalfield manager

[ Edited ]

Hi all,

 

I am created screen with a title bar and toolbar.

 

The toolbar is created using a HorizontalFieldManager.

 

Toolbar contain three BitmapField and a LabelField.

 

How can i handle key events of fields in the HorizontalFieldManager.

 

Where i need to override the keyChar() method.      

 

 

I did anything wrong here. I am not getting the Dialog box on pressing the enter key. It is moving to next icon thats all.

 

I can move to each icon by using the arrow keys, it is getting focus also. But when i press the enter key, it is going to next icon.

 

I want to show new screen on pressing the enter key on each icon in the HorizontalFieldManager.

 

How can i solve this problem.. Any help...

 

 

 

Message Edited by pc on 08-25-2009 02:38 AM
Please use plain text.
Developer
bikas
Posts: 984
Registered: ‎02-10-2009

Re: Key events on fields in custom horizontalfield manager

Override KeyDown() in your MainScreen. Like:

 

public boolean keyDown(int keycode, int time) { System.out.println("Enter key pressed!"); if (icon1.isFocus()) Dialog.inform("show page1"); else if (icon2.isFocus()) Dialog.inform("show page2"); else Dialog.inform("show page3"); return true; }

 

Regards

Bikas

 

 

Please use plain text.
New Developer
New Developer
pc
Posts: 16
Registered: ‎08-03-2009

Re: Key events on fields in custom horizontalfield manager

Thank you very much Bikas...

 

It solved my problem.

 

 

 

Please use plain text.
Developer
bikas
Posts: 984
Registered: ‎02-10-2009

Re: Key events on fields in custom horizontalfield manager

You are welcome. :smileyhappy:
Please use plain text.