10-21-2010 10:12 PM
I tried to apply setFocus() and setText() methods on a BasicEditField, but it always throws "Illegal state exception". However, getText() method can work.
Can someone explain this please? Thanks!
Solved! Go to Solution.
10-25-2010 05:11 AM
Well, I just tried to setText("xxx") after successfully getText().
It this is caused by trying to access the UI controls from outside of the event thread, I just wonder why would getText() worked?
10-25-2010 06:49 AM
One other thing could be if you are using filters on your EditField and you use setText() to set some thing that is not allowed by the filter, it will throw an exception....
10-26-2010 02:42 AM
Thanks KushBB, I think this may be the reason.
The BasicEditField is constructed as new BasicEditField(label,data,Integer.MAX_VALUE,r);
I'll try to remove the sytle, and try again.