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

Regular Contributor
Posts: 90
Registered: ‎09-16-2010
My Device: Not Specified

2 fields get focus at same time.

I have 2 horizontal field managers each with x child fields

1. Manager 1 has 4  fileds

2. Manager 2 has 3 fields


Now i want the navigation movement as below

 if i'm on manager 1 and my trackpad movement is horizontal, then my focus should be on manager 1 only  and the focus should move between the 4 fields.

now if my trackpad movement is down, my focus should go on manager 2.


In short , with up down movement, i should be toglling between manager 1 and 2.

and with left right trackpad movement , my focus should be moving to the fields within the same manager.


now my problem is, when i move from manager 1 --> manager 2 in that case , the 1st fields of each manager get focus at the same time.....really strange



Posts: 112
Registered: ‎04-28-2010
My Device: 8520
My Carrier: AirTel

Re: 2 fields get focus at same time.

Dear friend,


this is the problem of dirty and muddy, 2 fields can't get the focus together. u can check it by using the field change listener, only one will consume the click.


check the blackberry java docs Smiley SadField Class)


Field's "cleanliness" state
A field's cleanliness state tracks when changes happen to a field. When a field's contents are changed and the field still has the focus, the field is set to be both "muddy" and "dirty" (dirty is implied by the muddy state). After the focus moves away from the field, it loses the muddy state, but remains dirty, as its contents have still been changed. Only when the field is explicitly set to the clean state (by invoking setDirty(false)) does it become clean again.

Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: 2 fields get focus at same time.

[ Edited ]

Are any of the Managers or Fields involved custom (non-RIM) classes that override focus-related methods, such as setFocus, moveFocus, navigationMovement, trackwheelRoll, onFocus, onUnfocus, and the likes?

Regular Contributor
Posts: 90
Registered: ‎09-16-2010
My Device: Not Specified

Re: 2 fields get focus at same time.

my problem got solved.

my manager had  bitmap fields and i was changing the images for the bitmap field in the focus and unfocus method.

for focus method i was setting a focus bitmap, and unfocused bitmap for the unfocused state.


however instead if i used drawFocus , it worked