Comparing data sets on two drop down lists


In a window in the vision module, I have two drop down lists, they have the exact same data set.

For this lets say my data set is 2 columns, 3 rows…

Data set 1 Data set 2
(value, label) (value, label)

1, data 1 1, data 1
2, data 2 2, data 2
3, data 3 3, data 3

How can I configure the drop down list for data set 2, so it cannot select the same data that is selected in data set 1?

So if I selected “data 1” in drop down list 1, it would be awesome if “data 1” didn’t show up in drop down list 2, but if that’s not possible, I at least need it so that it is not selectable.

I found a way to do this by using an expression binding on the value of drop down list 2, but I can’t do that because I need the value to be bound to another tag that I pass back to a PLC.

Any ideas???

Thanks a lot!

This will take that dataset in the first dropdown, delete the selected row, then move the resultant dataset into the other dropdown.

In a propertyChange script:

if event.propertyName=="selectedIndex": if event.newValue != -1: dataOut=system.dataset.deleteRow(dataIn,event.newValue) event.source.parent.getComponent('Dropdown 2').data=dataOut event.source.parent.getComponent('Dropdown 2').selectedIndex=-1 else: event.source.parent.getComponent('Dropdown 2').data=dataIn

Here is a sample window.
dropdown_2015-07-24_1358.proj (7.18 KB)