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

New Developer
Posts: 53
Registered: ‎06-07-2011
My Device: 9800 torch
My Carrier: o2

Highlights on HorizontalFieldManager.

currently implementing a custom list, with a thumbnail to the left and two textFields stacked ontop of each other to the right of the thumbnail.


got them setup right and the views are showing correctly. Just now some highlighting problems, I cant get the selectiong and unselect states correct.


I know I need to override touchEvent  but dont know which states. I either get to many of the seperate hfm's or none of them. 

I need them to lightup when touched/dragged and when clicked a different colour. Then when untouched leave just one highlighted. Currently more than one seams to light up when dragged.


Also having a problem where the trackpad highlighted and the one selected by touch are two seperate entities.


also scroll doesnt work properly, when moving off screen with the trackpad the screen doesnt scroll down, only scrolls down when reaching the bottom


help please

Posts: 410
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free

Re: Highlights on HorizontalFieldManager.

It once tried your way, but I find it far better to implement that kind of list with ObjectListField. But you have to position each cell pixel-relative.


If you keep this way, do not use touchEvent  for focus state, let Blackberry manage focus, just decide what to draw.


To know when the field get the focus use:

protected void onFocus(int direction) {}

protected void onUnfocus() {}


Override that method to disable default blue-selected color:

protected void drawFocus(Graphics graphics, boolean on) {