How to make a blackberry BitmapField
non-focusable in runtime? I want make it dimmed based on a certain event.
How to make a blackberry BitmapField non focusable in runtime
100 Views Asked by Mahmoud Gamal El-Refaie At
2
There are 2 best solutions below
1

Most of times this works:
field.setEditable(false);
You can also create a non-focusable field by passing the style flag Field.NON_FOCUSABLE
or Field.FOCUSABLE
to the constructor, but once instantiated you cannot change it's focusable state. Even if you could, then the field won't look "dimmed" or "disabled", but simply the focus will jump to the next focusable field after it. An example of this are non-focusable label fields.
UPDATE: This would work for built in fields like EditFields, Checkbox, RadioButtons, etc. In your case, this does not work since a BitmapField is not "editable", it's a read only field. You can make a trick like @adwiv answer shows, but the "disabled" or gray overlay you'll have to implement it yourself.
Extend the BitmapField to override the
isFocusable()
method like this: