Pass Name to Popup Button

Hello all,

I am currently opening a popup when you click on a valve. The popup has buttons to put the valve in manual, off, or auto mode.
However, I'm not sure how to pass the name of the valve into the actual buttons. I have the name passing to other parts of the popup, but I don't see how I can set a tag via the valve name.

In the picture below, I have my path, but "ValveName" is just a place holder right now. I've only been able to control one valve, but surely there must be a way to pass the parameter in somehow.

Pass the path to the tag to the popup, then use this to dynamically bind labels, buttons and whatnot to the tag with indirect tag bindings.
Assuming you're using a multi state button, use a bidirectional binding on the control value property so clicking the button will write to the tag.
Don't use scripting for this.

3 Likes

In the event editor, the Navigation, Set Tag Value, SQL Update, and Set Property tabs are really just tools that write a script for you. That script is visible in the Script Editor tab, with a warning not to edit it if you wish to continue using the other four tabs.

To do dynamic things, you generally need to modify that script. In this case, to use a variable, typically from your root container, instead of the constant tag path you show.

You will need to learn to use jython scripting.