09-06-2008 05:22 PM - edited 09-06-2008 06:25 PM
I know i could set EditField focusable or non-focusable in its Constructor by setting the style.
But I want to set it focusable or non-focusable when running like setEditable(boolean editable). How could i do that?
I try to use new Constructor with focusable or non-focusable style . But it doesn't work.
It seems after the variable is added to the screen. It cannot be set focusable or -non-focusable again.
09-06-2008 06:04 PM
Correct, for the standard Rim class, once set in the Constructor, it is fixed for life of the supplied EditField..
You have two choices:
1) Create a new EditField with the Style you want, and replace the incorrect one in the Manager with the correct one.
2) Override the isFocusable() method, like the following:
public class MyEditField extends EditField { private boolean _focusableFlag; public MyEditField(String label, String initial) { super(label, initial); } public boolean isFocusable() { return _focusableFlag; } public void setFocusable(boolean focusable) { _focusableFlag = focusable; } }