Booleans in table component

I’m experiencing an issue with booleans in a table component. (I’m using FactoryPMI Version: 3.3.1 (build 2549))

My table has 9 columns. The last 6 columns I want to handle as boolean values. The underlying values however are integers (i.e., either a 1 or a 0). I’ve used the component customizer to designate these columns as being booleans and editable.

Some times, but not always, an error is generated whenever I click on a boolean checkbox. I’ve experienced this issue in both the development and runtime environments. I think the error is generated by the “built-in” code of the component. I don’t understand why it would happen sometimes and not every time.

Here’s the error message:

[quote]java.lang.ClassCastException: Error trying to coerce ‘false’ to a class java.lang.Integer
at com.inductiveautomation.factorypmi.common.utils.TypeUtilities.coerce(TypeUtilities.java:511)
at com.inductiveautomation.factorypmi.application.script.builtin.DatasetUtilities.setValue(DatasetUtilities.java:631)
at com.inductiveautomation.factorypmi.application.components.PMITable$DataSetTableModel.setValueAt(PMITable.java:1820)
at com.inductiveautomation.factorypmi.application.components.table.SortTableModel.setValueAt(SortTableModel.java:306)
at javax.swing.JTable.setValueAt(Unknown Source)
at javax.swing.JTable.editingStopped(Unknown Source)
at javax.swing.AbstractCellEditor.fireEditingStopped(Unknown Source)
at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(Unknown Source)
at javax.swing.DefaultCellEditor.stopCellEditing(Unknown Source)
at javax.swing.DefaultCellEditor$EditorDelegate.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.JToggleButton$ToggleButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
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.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(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.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)[/quote]
I’ve tried to convert my underlying data to use java.lang.Boolean values but that causes other issues.

Any ideas on how to address this issue would be most welcomed.

Thanks