07-25-2008 04:31 PM
I am getting an exception : tried to remove FieldWithFocus when using the API function:
I do understand why the exception is happening, but according to the documentation, it should not happen.
The doc says the following:
" Removes a field from this Manager and replaces it with another field. The specified oldField must be a direct child of this manager and the specified newField must not be being managed by any Manager, including this one.
If oldField had the focus and newField is focusable, then Field.setFocus() will be invoked on newField after it is added to this manager. "
So, is this a bug? or am i missing something?
07-25-2008 04:33 PM
It sounds like you are making the call from outside of the main event thread. Please see the link below for more information.
How to - Update a screen on the Main Event Thread
Article Number: DB-00136
07-28-2008 04:36 PM
The call is made from the main event thread.
I have also noticed in other places that if a button has the focus and I try to remove it from its manager, it gives the same exception.
My work around this exception is to make sure to first remove the focus from a field/button that is going to be removed from its manager. And that is what the replace function is supposed to do according to its documentation.
07-28-2008 06:05 PM
07-29-2008 09:27 AM