Opening pages using dropdown

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:

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

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 = path = data.getValueAt(event.newValue,"Path") system.nav.openWindow(path)

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:

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

I guess the idea was to create a new column instead of a new row. Your dataset should then look like the attached screenshot.

oh ha, Column, now why was I thinking row i have no clue… :open_mouth: I’m going to try that and will have an update shortly. :thumb_right: :thumb_left: