Text Field not registering Enter key

I’m not quite sure when it happened, but the Text Field in my console is no longer registering when you hit enter and is therefore not triggering the onAction event I have attached to it, rendering it effectively useless.

Servoy Version: 5.2.6 - build 1011
Java™ SE Runtime Environment (build 1.6.0_21-b06)

console_module.servoy (23 KB)

More details…

When run from client mode this is output to the Java console

Exception occurred during event dispatching:
java.lang.NullPointerException
	at com.servoy.j2db.smart.dataui.DataLookupField.commitSelectedValue(DataLookupField.java:340)
	at com.servoy.j2db.smart.dataui.DataLookupField.processKeyEvent(DataLookupField.java:281)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.Dialog$1.run(Unknown Source)
	at java.awt.Dialog$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.Dialog.show(Unknown Source)
	at java.awt.Component.show(Unknown Source)
	at java.awt.Component.setVisible(Unknown Source)
	at java.awt.Window.setVisible(Unknown Source)
	at java.awt.Dialog.setVisible(Unknown Source)
	at com.servoy.j2db.util.JEscapeDialog.setVisible(JEscapeDialog.java:165)
	at com.servoy.j2db.FormDialog.setVisible(FormDialog.java:149)
	at com.servoy.j2db.smart.SwingFormManager.showFormInDialog(SwingFormManager.java:790)
	at com.servoy.j2db.scripting.JSApplication.js_showFormInDialog(JSApplication.java:1855)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:179)
	at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:353)
	at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:81)
	at org.mozilla.javascript.gen.c61._c0(showConsole:2104)
	at org.mozilla.javascript.gen.c61.call(showConsole)
	at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:111)
	at org.mozilla.javascript.gen.c54._c0(_debug:127)
	at org.mozilla.javascript.gen.c54.call(_debug)
	at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:111)
	at org.mozilla.javascript.gen.c53._c0(_1:51)
	at org.mozilla.javascript.gen.c53.call(_1)
	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127)
	at org.mozilla.javascript.gen.c53.call(_1)
	at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:476)
	at com.servoy.j2db.FormController.executeFunction(FormController.java:3977)
	at com.servoy.j2db.FormController.executeFunction(FormController.java:3865)
	at com.servoy.j2db.FormController.executeFunction(FormController.java:3787)
	at com.servoy.j2db.FormController.executeFunction(FormController.java:3779)
	at com.servoy.j2db.smart.scripting.ScriptMenuItem$1.run(ScriptMenuItem.java:96)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

James,

This seems to be a new issue, please file a case in our support system and attach the sample.

Rob

i fixed this, why is devCommandList always empty?
Is that being filled with something?

jcompagner:
i fixed this, why is devCommandList always empty?
Is that being filled with something?

Good question. I think when I originally designed this it was being filled with previous commands so that that you could cycle back through them, but I have since moved on to other ways of handling this.

Is having that valuelist on the field what is causing the error?

Edit:
After testing, yes that is what was causing it. :oops:
Thanks for pointing that out Johan!

yes it is because of that empty valuelist,
if you remove it or add 1 item to that list it will work fine.
But i fixed this, so now starting with an empty valuelist will not fail.

boy, that was EXACTLY the problem I had last week!! for now we worked around it…