How to get components on a second pop-up instance instance?

Hi! I am creating a script to get a component on a popup.

	window = system.gui.getWindow('Dashboard/Pop-ups/KWH Consumption') 
	event.source.getComponent('Bar Chart').data = window.getRootContainer().datasetForGraphing

But when there are multiple instances of the popups are open the script still references to the first pop up. I tried searching this forum for an answer and I saw that every popup window or any open window has a unique hash. I can print the hash using this code:

print event.source.hashCode()

How can I use the hash code to get a component on a popup instance similar to system.gui.getWindow? Is there a better way to get components on multiple popup instances?

You’ll have to get all the opened windows and loop through them to find the hash you want.

I already did that but how can I get a component property using a hash code?

Here is my actual project:

I want to get the selected string value of a dropdown on the second pop-up instance. How can I do that using a hash code?

When you look through the opened windows (from system.gui.getOpenedWindows), the list is of window objects, just like from .getWindow(). Hang onto the window object that has the hash you want. Look up your component in that window’s .rootContainer.

1 Like