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

Posts: 813
Registered: ‎05-29-2012
My Device: see later
My Carrier: see later

Horizontalfieldmanager scroll focus/unfocus problem

Okey I have in my page a picture at the top.

And below I have a horizontalfieldmanager of 20 pictures ( scrollable).

Lets say i scroll the horizontalfieldmanager and focus on 10th picture.I then move my focus to the picture at the top...

then move it back to the horizontalfieldmanager 


a problem would arise. the focus will be on the first picture which is out of my screen..
 ( as i scrolled and focused on 10th pic)


how can I fix this issue?


Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: Horizontalfieldmanager scroll focus/unfocus problem

You should control the focus programmatically. The best way would be to remember the last field in focus and set focus to it when the manager regains the focus.


Set a FocusChangeListener on the HorizontalFieldManager. In focusChanged of the listener, check whether there is any saved "last field in focus" on FOCUS_GAINED and jump there if yes, and save the field in focus as "last field in focus" on FOCUS_CHANGED. There is nothing to do on FOCUS_LOST.


Good luck!

please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!