private final KeyboardListener keyboardListener
= new KeyboardListenerAdapter()
{
public void onKeyDown(Widget widget,char c, int i)
{
super.onKeyDown(widget, c, i);
if (KeyboardListener.KEY_ENTER == c)
{
textBox.removeKeyboardListener(keyboardListener);
}
}
};
public void onModuleLoad()
{
textBox.addKeyboardListener(keyboardListener);
}
I'm getting the following exception in hosted mode:
[ERROR] Uncaught exception escaped
java.util.ConcurrentModificationException: null
at java.util.AbstractList
$Itr.checkForComodification(AbstractList.java:448)
at java.util.AbstractList$Itr.next(AbstractList.java:419)
at
com.google.gwt.user.client.ui.KeyboardListenerCollection.fireKeyDown(KeyboardListenerCollection.java:
81)
at
com.google.gwt.user.client.ui.KeyboardListenerCollection.fireKeyboardEvent(KeyboardListenerCollection.java:
55)
at
com.google.gwt.user.client.ui.TextBoxBase.onBrowserEvent(TextBoxBase.java:
167)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:968)
at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java:951)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:919)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:324)
Should it bother me since i'm not getting any errors in javascript and
browsers are single-threaded? Well actually it annoys me cause i don't
like any errors showing=)
DeferredCommand.add(new Command() {
public void execute() {
textBox.removeKeyboardListener(keyboardListener);
}
});
--
Sandy McArthur
"He who dares not offend cannot be honest."
- Thomas Paine