Cant toggle to preview mode

Here is the stack race of error.

Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException at com.inductiveautomation.factorypmi.application.components.PMIComboBox.getTranslatedData(PMIComboBox.java:261) at com.inductiveautomation.factorypmi.application.components.PMIComboBox.localeChanged(PMIComboBox.java:377) at com.inductiveautomation.factorypmi.application.components.util.ComponentVisitor$LocaleChangedVisitor.visit(ComponentVisitor.java:332) at com.inductiveautomation.factorypmi.application.components.util.ComponentVisitor.walk(ComponentVisitor.java:77) at com.inductiveautomation.factorypmi.application.components.util.ComponentVisitor.walk(ComponentVisitor.java:57) at com.inductiveautomation.factorypmi.application.FPMIWindow$1.localeChanged(FPMIWindow.java:136) at com.inductiveautomation.ignition.designer.i18n.DesignerLocalizationManager.fireLocaleChanged(DesignerLocalizationManager.java:517) at com.inductiveautomation.ignition.designer.i18n.DesignerLocalizationManager.setCurrentLocale(DesignerLocalizationManager.java:143) at com.inductiveautomation.ignition.designer.i18n.DesignerLocalizationManager.resetLocale(DesignerLocalizationManager.java:159) at com.inductiveautomation.factorypmi.application.FPMISystem.setMode(FPMISystem.java:38) at com.inductiveautomation.factorypmi.designer.workspace.WindowWorkspace$1.propertyChange(WindowWorkspace.java:269) at java.beans.PropertyChangeSupport.fire(Unknown Source) at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source) at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source) at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source) at java.awt.Component.firePropertyChange(Unknown Source) at javax.swing.JComponent.firePropertyChange(Unknown Source) at com.inductiveautomation.ignition.designer.designable.AbstractDesignableWorkspace.setDesignTime(AbstractDesignableWorkspace.java:304) at com.inductiveautomation.factorypmi.designer.workspace.WindowWorkspace$Handler$10.itemStateChanged(WindowWorkspace.java:2098) at com.inductiveautomation.ignition.client.util.action.StateChangeAction.setSelected(StateChangeAction.java:98) at com.inductiveautomation.ignition.designer.model.menu.JMenuMerge$1.itemStateChanged(JMenuMerge.java:112) at javax.swing.AbstractButton.fireItemStateChanged(Unknown Source) at javax.swing.AbstractButton$Handler.itemStateChanged(Unknown Source) at javax.swing.DefaultButtonModel.fireItemStateChanged(Unknown Source) at javax.swing.JToggleButton$ToggleButtonModel.setSelected(Unknown Source) at javax.swing.JToggleButton$ToggleButtonModel.setPressed(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI$Actions.actionPerformed(Unknown Source) at javax.swing.SwingUtilities.notifyAction(Unknown Source) at javax.swing.JComponent.processKeyBinding(Unknown Source) at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(Unknown Source) at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(Unknown Source) at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(Unknown Source) at javax.swing.JMenuBar.processKeyBinding(Unknown Source) at javax.swing.KeyboardManager.fireBinding(Unknown Source) at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source) at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source) at javax.swing.JComponent.processKeyBindings(Unknown Source) at javax.swing.JComponent.processKeyEvent(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.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.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(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)

Anyone have an idea about this?
Thank you.

I was getting this error in our test environment in version 7.7.4 after restoring a project built in 7.5.13. I took a lot of trial and error to figure out what was causing the problem.

In my case we had a couple of Dropdown List controls that were both bound to datasets that were custom properties of the root container. The datasets were both empty when the window had been saved previously and whenever preview mode was started I got the same (if not similar) error and preview mode was not properly started.

I solved this problem by adding a column to both of the datasets and changing the script that initialized the datasets.

# Old script that causes errors 
#event.source.parent.distinctTagList = None
#event.source.parent.inclusiveDistinctTagList = None

# Instead do this
event.source.parent.distinctTagList = system.dataset.toDataSet(["tags"],[[""]])
event.source.parent.inclusiveDistinctTagList = system.dataset.toDataSet(["tags"],[[""]])

I would check any bindings on the components of the window you are trying to preview.

A similar situation can be recreated in version 7.7.4 by taking the following steps:
-Make a new window
-Add a button and a Dropdown list
-In the actionPerformed event of the button set the data property of the Dropdown List to None
-Make the output console visible
-Start preview mode
-Click the button

You will see the error in the console and the designer is now stuck in preview mode. To get the designer out of this state, close the window. Now you can exit preview mode.

Thank you very much for the detailed solution. Well i do have some custom properties(string queries)on the root container that i call on one of my components. What i did was to restart the designer, i guess you’re right on the part where the datasets doesn’t have any value on them.

FWIW, this has been fixed in 7.7.5-rc1