Problem with Null pointers in a window

I’m experiencing a problem. I have a control dialog box much like your System Control example that is passed a number of parameters when it is opened. Whenever I save in the Designer or run this for the first time as a project, I receive a number of java Null pointer errors for various components. It appears to me they are uninitialized somehow. When I look at the values in Designer, they are 0 or 1.

Is there a way to work around this problem?

Thanks in advance.

Error report:
java.lang.NullPointerException
at com.inductiveautomation.factorypmi.application.binding.expression.DefaultFunctionFactory$IfFunction.execute(DefaultFunctionFactory.java:864)
at com.inductiveautomation.factorypmi.application.binding.expression.FunctionExpression.execute(FunctionExpression.java:46)
at com.inductiveautomation.factorypmi.application.binding.expression.DefaultFunctionFactory$IfFunction.execute(DefaultFunctionFactory.java:875)
at com.inductiveautomation.factorypmi.application.binding.expression.FunctionExpression.execute(FunctionExpression.java:46)
at com.inductiveautomation.factorypmi.application.binding.ExpressionPropertyAdapter.connect(ExpressionPropertyAdapter.java:79)
at com.inductiveautomation.factorypmi.application.FHMIWindow.connectAdapters(FHMIWindow.java:215)
at com.inductiveautomation.factorypmi.application.FHMIApp.openWindow(FHMIApp.java:731)
at com.inductiveautomation.factorypmi.application.FHMIApp.openWindow(FHMIApp.java:688)
at com.inductiveautomation.factorypmi.designer.model.ObjectHolder.openWindow(ObjectHolder.java:1997)
at com.inductiveautomation.factorypmi.designer.navtree.ProjectBrowserPanel.mousePressed(ProjectBrowserPanel.java:387)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.AWTEventMulticaster.mousePressed(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.pumpOneEventForHierarchy(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)

What version are you using? It sounds like you’ve got null values coming in from the database, which typically indicates some sort of setup problem with your queries / tables.

I am using the latest version 2.2. One thing I should add though. I’m passing these variables in a dataset structure, then I lookup the values and assign them to my dynamic properties using ‘lookup’. Is is possible I have a race condition? My other approach is to hard code variables and pass the values using a more traditional approach.

No, this approach should work just fine. I’m pretty convinced that you just have null values in your dataset that you’re passing around. You can either correct the nulls, or use the coalesce function to guard against them.

Of course, its always possible that this is a bug of some sort. If you’d like help debuging this interactively, call us and we can do a GoToMeeting to figure out what is going on.

I’ll give it a try today. Thanks.