# Opening pages using dropdown

**URL:** <https://forum.inductiveautomation.com/t/opening-pages-using-dropdown/10197>\
**Category:** Ignition\
**Created:** [July 7, 2015, 4:33pm UTC](https://forum.inductiveautomation.com/t/opening-pages-using-dropdown/10197 "2015-07-07T16:33:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [July 7, 2015, 4:33pm UTC](https://forum.inductiveautomation.com/t/opening-pages-using-dropdown/10197/1 "2015-07-07T16:33:22Z")

</div>

I would like to be able to open some pages using a drop down menu, created a drop down and in data set viewer, added the name of the pages and gave them a value, now I assume I need to use scripting under drop down component scripting? something like:

```auto
if event.source.selectedValue = 0 
          system.nav.openWindow('Main Windows/WindowA')
elif event.source.selectedValue = 1
          system.nav.openWindow('Main Windows/WindowB')
...
```

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/9f1066fe62e6a37853c653fbb72344250f752b61.jpg)

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [July 7, 2015, 6:33pm UTC](https://forum.inductiveautomation.com/t/opening-pages-using-dropdown/10197/2 "2015-07-07T18:33:31Z")

</div>

Add an additional column named “Path” to the dropdown’s dataset. This will hold the path to the window.

Then add the following to the dropdown propertyChange

`if event.propertyName == "selectedIndex":
	if event.newValue != -1:
		data = event.source.data
		path = data.getValueAt(event.newValue,"Path")
		system.nav.openWindow(path)`

---

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [July 8, 2015, 2:19pm UTC](https://forum.inductiveautomation.com/t/opening-pages-using-dropdown/10197/3 "2015-07-08T14:19:19Z")

</div>

but if i include that in my drop down dataset then it will be visible every time the drop down is selected.  
I tried it anyway and i get this error:

```auto
Traceback (most recent call last):

  File "<event:propertyChange>", line 4, in <module>

java.lang.ArrayIndexOutOfBoundsException: java.lang.ArrayIndexOutOfBoundsException: Column 'Path' doesn't exist in this dataset.

	caused by ArrayIndexOutOfBoundsException: Column 'Path' doesn't exist in this dataset.

Ignition v7.7.0 (b2014071516)
Java: Oracle Corporation 1.8.0_45

```

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5bd89e992f74f865cb57455b69d4ac94b3cb26bc.jpg)

---

<div class="post-metadata">

**Author:** ![Amarth](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarth/32/3313_2.png) [@Amarth](https://forum.inductiveautomation.com/u/Amarth)\
**Post date:** [July 8, 2015, 2:54pm UTC](https://forum.inductiveautomation.com/t/opening-pages-using-dropdown/10197/4 "2015-07-08T14:54:53Z")

</div>

I guess the idea was to create a new column instead of a new row. Your dataset should then look like the attached screenshot.  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5b4d3ad59e6d22651bb6e009c002f6f46e035d28.png)

---

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [July 8, 2015, 3:30pm UTC](https://forum.inductiveautomation.com/t/opening-pages-using-dropdown/10197/5 "2015-07-08T15:30:26Z")

</div>

oh ha, Column, now why was I thinking row i have no clue… 😮 I’m going to try that and will have an update shortly. ![:thumb_right:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/2026e28c0c425034352c1b75807edf956adc75f4.gif ":thumb\_right:") ![:thumb_left:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e26afb081ddde6df016df6ee49159cf56aaca688.gif ":thumb\_left:")
