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
alfonsn
Posts: 34
Registered: ‎08-11-2011
My Device: BlackBerry Bold
My Carrier: Axis
Accepted Solution

Determining Whether A Navigation Key Press Will Change The Screen's Current Focus

[ Edited ]

Hi, I was wondering if there is anyway to determine whether a navigation key press will change the screen's focus to another field or not?

 

Thanks in advance.

Please use plain text.
Developer
YamilBracho
Posts: 713
Registered: ‎05-31-2010
My Device: 8520
My Carrier: Movistar

Re: Determining Whether A Navigation Key Press Will Change The Screen's Current Focus

I do not understand clearly your question but Manager class has getFieldWithFocus() , returning which field have the focus... 

Please use plain text.
Developer
alfonsn
Posts: 34
Registered: ‎08-11-2011
My Device: BlackBerry Bold
My Carrier: Axis

Re: Determining Whether A Navigation Key Press Will Change The Screen's Current Focus

Say for example I have a horizontal field manager with 3 focusable fields. When I press a navigation key, in this case the right or left key, I want to be able to determine whether the field with focus has changed or not. As you know, in this case if we press the right key when the focus is on the third field (the right most field in the manager) the focus won't change to another field.
Please use plain text.
Developer
YamilBracho
Posts: 713
Registered: ‎05-31-2010
My Device: 8520
My Carrier: Movistar

Re: Determining Whether A Navigation Key Press Will Change The Screen's Current Focus

well, also, Field has a isFocus() method that returns true if a the field has the focus. I think you can combine with  getFieldWithFocus() to get what you want...

Please use plain text.
Developer
alfonsn
Posts: 34
Registered: ‎08-11-2011
My Device: BlackBerry Bold
My Carrier: Axis

Re: Determining Whether A Navigation Key Press Will Change The Screen's Current Focus

I guess I could put the current field with focus inside a variable and compare it with the field that gains focus when I press a navigation key. Thanks for your answer. I'll accept it as a solution.
Please use plain text.