Error with property binding a committed Value from a formatted text field?

This is really getting into the minutiae of our project, so if there is no answer or solution its not a big deal, but I’ve recently been trying to clean up all the warnings/errors that populate the Log Viewer on a per window basis.

We have a window that has a string customer property on the root container, xfer_quoteDate, which is bidirectionally bound to a committed value of a formatted text field. When the form on this window is submitted, I get this error in the logger

Message
[component=Root Container,property=xfer_quoteDate] Unable to set property "committedValue" on: com.inductiveautomation.factorypmi.application.components.PMIFormattedTextField[txt_quoteDate,141,179,100x26,layout=javax.swing.plaf.basic.BasicTextUI$UpdateHandler,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.synth.SynthBorder@33a386ad,flags=16777504,maximumSize=,minimumSize=,preferredSize=java.awt.Dimension[width=64,height=22],caretColor=,disabledTextColor=javax.swing.plaf.ColorUIResource[r=171,g=181,b=190],editable=true,margin=javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0],selectedTextColor=javax.swing.plaf.ColorUIResource[r=46,g=46,b=46],selectionColor=javax.swing.plaf.ColorUIResource[r=213,g=238,b=255],columns=0,columnWidth=0,command=,horizontalAlignment=RIGHT]
Time
Thu Jan 9 10:36:33AM
Severity
ERROR
Logger
vision.binding.property-binding
Stack Trace
java.lang.reflect.InvocationTargetException: null
     at jdk.internal.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.base/java.lang.reflect.Method.invoke(Unknown Source)
     at com.inductiveautomation.factorypmi.application.binding.util.StaticPropertyNode.setValue(StaticPropertyNode.java:75)
     at com.inductiveautomation.factorypmi.application.binding.SimpleBoundPropertyAdapter.pushToSource(SimpleBoundPropertyAdapter.java:154)
     at com.inductiveautomation.factorypmi.application.binding.SimpleBoundPropertyAdapter$1.propertyChange(SimpleBoundPropertyAdapter.java:135)
     at java.desktop/java.beans.PropertyChangeSupport.fire(Unknown Source)
     at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
     at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
     at java.desktop/java.awt.Component.firePropertyChange(Unknown Source)
     at java.base/jdk.internal.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)
     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.base/java.lang.reflect.Method.invoke(Unknown Source)
     at com.inductiveautomation.factorypmi.application.binding.util.DynamicPropertyUtil.firePropertyChange(DynamicPropertyUtil.java:291)
     at com.inductiveautomation.factorypmi.application.binding.util.DynamicPropertyUtil.setPropertyValue(DynamicPropertyUtil.java:282)
     at com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel.setPropertyValue(AbstractVisionPanel.java:165)
     at jdk.internal.reflect.GeneratedMethodAccessor154.invoke(Unknown Source)
     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.base/java.lang.reflect.Method.invoke(Unknown Source)
     at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:188)
     at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:206)
     at org.python.core.PyObject.__call__(PyObject.java:515)
     at org.python.core.PyObject.__call__(PyObject.java:519)
     at org.python.core.PyMethod.__call__(PyMethod.java:156)
     at org.python.pycode._pyx86.dbToRc$2(<module:app.window>:156)
     at org.python.pycode._pyx86.call_function(<module:app.window>)
     at org.python.core.PyTableCode.call(PyTableCode.java:171)
     at org.python.core.PyBaseCode.call(PyBaseCode.java:154)
     at org.python.core.PyFunction.__call__(PyFunction.java:423)
     at org.python.pycode._pyx86.clearFields$4(<module:app.window>:232)
     at org.python.pycode._pyx86.call_function(<module:app.window>)
     at org.python.core.PyTableCode.call(PyTableCode.java:171)
     at org.python.core.PyBaseCode.call(PyBaseCode.java:139)
     at org.python.core.PyFunction.__call__(PyFunction.java:413)
     at org.python.pycode._pyx140.update$1(<event:visionWindowOpened>:211)
     at org.python.pycode._pyx140.call_function(<event:visionWindowOpened>)
     at org.python.core.PyTableCode.call(PyTableCode.java:171)
     at org.python.core.PyBaseCode.call(PyBaseCode.java:308)
     at org.python.core.PyFunction.function___call__(PyFunction.java:471)
     at org.python.core.PyFunction.__call__(PyFunction.java:466)
     at org.python.core.PyFunction.__call__(PyFunction.java:456)
     at org.python.core.PyFunction.__call__(PyFunction.java:451)
     at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:788)
     at com.inductiveautomation.factorypmi.application.script.builtin.ClientSystemUtilities.lambda$invokeLater$1(ClientSystemUtilities.java:276)
     at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
     at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
     at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
     at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
     at java.base/java.security.AccessController.doPrivileged(Native Method)
     at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
     at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
     at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
     at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
     at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
     at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
 Caused by: java.lang.NullPointerException: null
     at java.desktop/javax.swing.text.MaskFormatter.getInvalidOffset(Unknown Source)
     at java.desktop/javax.swing.text.MaskFormatter.stringToValue(Unknown Source)
     at java.desktop/javax.swing.text.MaskFormatter.stringToValue(Unknown Source)
     at com.inductiveautomation.factorypmi.application.components.PMIFormattedTextField.setCommittedValue(PMIFormattedTextField.java:260)
     ... 57 common frames omitted

Now it saves fine, so whatever this error is isn’t breaking anything. But it’s annoying I can’t clear it from my Log Viewer by fixing something as I don’t know whats going wrong. Any insights as to what this error means?

It usually means that a binding is supplying a null at window startup (common with tag bindings) that your binding is trying to apply to the text of your formatted field. Which doesn’t accept nulls on that string property.

This is normally addressed by including a coalesce() operation in a binding, but you can’t get bidirectional behavior from that. Consider using a uni-directional binding and handling the reverse path with a propertyChange event.

1 Like

Ok well this whole windows a scripting nightmare so I’ll just put it on the low priority refactor to do list. Thanks for the info.