How to go into different windows using dropdown list?


I want to know how to use the drop down list. Is it possible to go to another window using the drop down list instead of using the buttons?

For example, I have two windows for Trends namely Trend 1 and Trend 2. I made two columns, both for string.

Col1 Col2
Trend 1 Trend 1
Trend 2 Trend 2

Col1 for the windows to open and Col2 is the display name. Now by selecting Trend 1 in the dropdown list, can I open the Trend 1 window? Please tell me how to do this?

All you need to do is add a propertyChange event to the dropdown list that opens a window when the user selects a different option. Add the following script to the propertyChange event handler:if event.propertyName == "selectedStringValue": value = event.newValue if value != "": system.nav.openWindow(value)You can use the following to swap:if event.propertyName == "selectedStringValue": value = event.newValue if value != "": system.nav.swapTo(value)If you get any errors post the full details of the error.

Thanks a lot Travis, it works fine now.

There is a problem with this script.
If I have several windows to select and i selected one of them before and then i returned to specific option again there is no new Value because it selected before.
How can I initialize selectedStringValue after clicked on it?

I figured out, after selected I just put 0 inside selectedValue.


I am using this method to opening up windows. It works however I keep getting the following error message:

Traceback (most recent call last):
File “event:propertyChange”, line 8, in
ValueError: Window does not exist.

at org.python.core.Py.ValueError(
at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilities$
at com.inductiveautomation.factorypmi.application.script.builtin.WindowUtilities.doGUIAction(
at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilities.openWindowImpl(
at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilities.openWindow(
at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilitiesDispatcher.openWindow(
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.python.core.PyReflectedFunction.__call__(
at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction.__call__(
at org.python.core.PyObject.__call__(
at org.python.core.PyObject.__call__(
at org.python.pycode._pyx0.f$0(<event:propertyChange>:13)
at org.python.pycode._pyx0.call_function(<event:propertyChange>)
at org.python.core.Py.runCode(
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.access$000(
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter$
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$ Source)
at java.awt.EventQueue$ Source)
at Method)
at$JavaSecurityAccessImpl.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 Source)

Ignition v7.9.12 (b2019070213)
Java: Oracle Corporation 1.8.0_191

What is it complaining when it works? How can I get rid of this message?

Thanks a lot.

Never mind…it looks like you have to have the if condition for event.newValue != “” in there!