# Dropdown list function required

**URL:** <https://forum.inductiveautomation.com/t/dropdown-list-function-required/11551>\
**Category:** Ignition\
**Created:** [April 21, 2016, 12:05pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-function-required/11551 "2016-04-21T12:05:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![msamiryusuf](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@msamiryusuf](https://forum.inductiveautomation.com/u/msamiryusuf)\
**Post date:** [April 21, 2016, 12:05pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-function-required/11551/1 "2016-04-21T12:05:29Z")

</div>

Dear Colleagues

i have multiple of Main Windows and i need to navigate it using dropdown list not using the tabs

how i can do this function?

please assist

regards

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 21, 2016, 12:38pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-function-required/11551/2 "2016-04-21T12:38:38Z")

</div>

Have you looked at the Menus section of the client event scripts? That’s probably the most intuitive way to navigate while keeping maximum screen space for your windows.

---

<div class="post-metadata">

**Author:** ![msamiryusuf](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@msamiryusuf](https://forum.inductiveautomation.com/u/msamiryusuf)\
**Post date:** [April 21, 2016, 12:52pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-function-required/11551/3 "2016-04-21T12:52:49Z")

</div>

Can you show me how from by screen shots and if you can also give me a solution for dropdown menu will be much appreciate it

Regards

---

<div class="post-metadata">

**Author:** ![msamiryusuf](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@msamiryusuf](https://forum.inductiveautomation.com/u/msamiryusuf)\
**Post date:** [April 21, 2016, 12:53pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-function-required/11551/4 "2016-04-21T12:53:22Z")

</div>

i am new at ignition

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 21, 2016, 1:15pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-function-required/11551/5 "2016-04-21T13:15:38Z")

</div>

[quote=“msamiryusuf”]i am new at ignition[/quote]You should seriously consider going through the entire Inductive University curriculum (free), but for the moment just [jump to this video](https://inductiveuniversity.com/video/menubar?r=/course/scripting).

---

<div class="post-metadata">

**Author:** ![msamiryusuf](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@msamiryusuf](https://forum.inductiveautomation.com/u/msamiryusuf)\
**Post date:** [April 21, 2016, 9:28pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-function-required/11551/6 "2016-04-21T21:28:57Z")

</div>

what if i have 300 RTU’s and i need to navigate anyone of them in this case i need something customized like a drop down list but using client scripting it will be a long script need to be done for example if i need to navigate from RTU1 to RTU300 using database and dropdown list how it can be done

---

<div class="post-metadata">

**Author:** ![msamiryusuf](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@msamiryusuf](https://forum.inductiveautomation.com/u/msamiryusuf)\
**Post date:** [April 21, 2016, 10:02pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-function-required/11551/7 "2016-04-21T22:02:56Z")

</div>

i was checking the help and i found this syntax

dropdown = event.source.parent.getComponent(“Dropdown”)  
system.nav.swapTo(“MyWindow”, {“paramValue”:dropdown.selectedValue)

i tried to manipulate it but anyone try this syntax before and can you give me example

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [April 21, 2016, 10:33pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-function-required/11551/8 "2016-04-21T22:33:33Z")

</div>

[quote=“msamiryusuf”]i was checking the help and i found this syntax

dropdown = event.source.parent.getComponent(“Dropdown”)  
system.nav.swapTo(“MyWindow”, {“paramValue”:dropdown.selectedValue)

i tried to manipulate it but anyone try this syntax before and can you give me example[/quote]

```auto

dropdown = event.source.parent.getComponent("Dropdown")
system.nav.swapTo("MyWindow", {"paramValue":dropdown.selectedValue})

```

you are missing a curly bracket

---

<div class="post-metadata">

**Author:** ![msamiryusuf](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@msamiryusuf](https://forum.inductiveautomation.com/u/msamiryusuf)\
**Post date:** [April 22, 2016, 8:40pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-function-required/11551/9 "2016-04-22T20:40:28Z")

</div>

i tried it my friend and i have a window is called RTU2 and i get the error

Traceback (most recent call last):  
File “event:menu:RTU2”, line 1, in   
NameError: name ‘event’ is not defined

```
at org.python.core.Py.NameError(Py.java:260)
at org.python.core.PyFrame.getname(PyFrame.java:257)
at org.python.pycode._pyx0.f$0(<event:menu:RTU2>:2)
at org.python.pycode._pyx0.call_function(<event:menu:RTU2>)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1275)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:623)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:582)
at com.inductiveautomation.factorypmi.application.runtime.RuntimeMenu$JythonMenuActionListener.actionPerformed(RuntimeMenu.java:206)
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.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.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.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$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.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$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 java.awt.EventDispatchThread.run(Unknown Source)

```

Ignition v7.8.2 (b2016030813)  
Java: Oracle Corporation 1.8.0\_77

any advice ???

---

<div class="post-metadata">

**Author:** ![kavya\_shree](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kavya\_shree](https://forum.inductiveautomation.com/u/kavya_shree)\
**Post date:** [November 17, 2022, 5:20am UTC](https://forum.inductiveautomation.com/t/dropdown-list-function-required/11551/10 "2022-11-17T05:20:38Z")

</div>

yes it is very useful.  
but my requirement is dropdown should be on designer window and by selecting dropdown corresponding window should open.  
where we need to write the code.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/f/cfd3e0ab02d0cca7f5fdd3d4e9071e69f55d7004.png)

Please guide, it will be very useful for my project.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [November 17, 2022, 9:48am UTC](https://forum.inductiveautomation.com/t/dropdown-list-function-required/11551/11 "2022-11-17T09:48:20Z")

</div>

> [@kavya\_shree](#):
>
> where we need to write the code

The simplest approach would probably be to use the dropdown's propertyChange event handler.

First, add a column to the dropdown's data called path, and then use your window name in the label column like so:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/7/576f27a84ca2e9bc7320700992e1bd537957d86c.png)

The dropdown will look as follows:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/623e3102a7285368529c8a26822578ac19f33ef8.png)

The propertyChange script will use the selected value to find the path in the data to open your window. Here is the example code:

```auto
if event.propertyName == "selectedValue":
	data = event.source.data
	path = data.getValueAt(event.newValue, 2)
	system.nav.openWindow(path)

```

---

<div class="post-metadata">

**Author:** ![kavya\_shree](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kavya\_shree](https://forum.inductiveautomation.com/u/kavya_shree)\
**Post date:** [November 17, 2022, 11:44am UTC](https://forum.inductiveautomation.com/t/dropdown-list-function-required/11551/12 "2022-11-17T11:44:34Z")

</div>

Wow! Thank you so much. Its working perfect
