# Changing a property of a component on one window using an event on another window

**URL:** <https://forum.inductiveautomation.com/t/changing-a-property-of-a-component-on-one-window-using-an-event-on-another-window/96850>\
**Category:** Ignition\
**Tags:** vision, scripting\
**Created:** [October 4, 2024, 8:06pm UTC](https://forum.inductiveautomation.com/t/changing-a-property-of-a-component-on-one-window-using-an-event-on-another-window/96850 "2024-10-04T20:06:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harrison\_Quinn](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@Harrison\_Quinn](https://forum.inductiveautomation.com/u/Harrison_Quinn)\
**Post date:** [October 4, 2024, 8:06pm UTC](https://forum.inductiveautomation.com/t/changing-a-property-of-a-component-on-one-window-using-an-event-on-another-window/96850/1 "2024-10-04T20:06:48Z")

</div>

I am creating a project that has over 100 valves. When you click on any valve, a pop-up window appears and tells you if that valve is open or closed and allows for manual manipulation of the valve. If I didn't have hundreds of valves I could make a separate pop-up window for each valve, however, with the amount we have, we are looking to have one pop-up window that is dynamic and displays the status of the valve you click on. When you close the window and click another valve, the same window pops up displaying that valves status. I need help with scripting to accomplish this. Thank you.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [October 4, 2024, 8:20pm UTC](https://forum.inductiveautomation.com/t/changing-a-property-of-a-component-on-one-window-using-an-event-on-another-window/96850/2 "2024-10-04T20:20:37Z")

</div>

> [@Harrison\_Quinn](#):
>
> I could make a separate pop-up window for each valve

Never do this, the power of indirect bindings in Ignition is one of its most powerful points. You can create a single popup that can work across several variations of valves and is still maintenance friendly if you ever need to update it. Imagine having to update 100 valve popups because you added a status tag.

Design your popup in the following way: (this assumes all your valves have a UDT instance)

Create a custom property on the popup's root container with the name of `tagPath` or similar.

Next, create a custom property for every udt member that you will use on your popup window on the root container of the popup.

Indirectly bind these to the associated UDT member using the `tagPath` custom property as the first part of the indirection. Your indirect binding path would look something like `{1}/udtMember`, with {1} = {rootContainer.tagPath} in the mapping below it.

Then bind any visuals on the popup to the custom property associated with the udt member you are displaying.

This design also allows you to hide visuals if the associated UDT member doesn't exist on a particular valve. You just check the member binding's quality code and hide the visual if its a bad value.

When opening the popup, you can use a fairly simple script of `system.nav.openWindowInstance('designer/path/to/popup', {"tagPath": "path/to/valve/UDTtag"})` on a button's `onActionPerformed` script.

> **[system.nav.openWindowInstance | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-nav/system-nav-openWindowInstance)**
>
> Operates exactly like system.nav.openWindow, except that if the named window is already open, then an additional instance of the window will be opened.

---

<div class="post-metadata">

**Author:** ![Harrison\_Quinn](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@Harrison\_Quinn](https://forum.inductiveautomation.com/u/Harrison_Quinn)\
**Post date:** [October 4, 2024, 8:24pm UTC](https://forum.inductiveautomation.com/t/changing-a-property-of-a-component-on-one-window-using-an-event-on-another-window/96850/3 "2024-10-04T20:24:02Z")

</div>

Ryan, this is great information. Thank you for this. I am going to give this a shot and hopefully all goes well! Thank you!
