Passing Parameters to popup

Hello, I am trying to pass a couple custom properties from a main window to a popup window.

The two custom properties, both string values are:

The two string values are just the following tag paths.


I am using the following tag change event client script:

root = system.gui.getParentWindow(event).getRootContainer()

propVal1 = root.deck_run_fwd
propVal2 = root.deck_run_rev

As in the picture the statement: root = system.gui.getParentWindow(event).getRootContainer()
on line 12 throws the following error.

TypeError: getParentWindow(): 1st arg can't be coerced to java.util.EventObject

The script was working but I must have changed something somewhere and it does not work
Does anyone have any idea why the error occurs and how to fix it or find the source of the problem

The error is telling you what's wrong. In more detail: tag event scripts implicitly get a parameter that's called event. However, this is not the 'EventObject' that is expected by system.gui.getParentWindow. As the system.gui package implies, the event object you're expected to provide to system.gui.getParentWindow is a GUI event, such as a mouse click or key press.

The only way that line of code would ever work was if you were invoking it from a GUI event, such as a button's actionPerformed. Moving it to a client event script means it will never work, as written.
I suspect that the proper place for this logic is going to continue to be a GUI event hook.
Think of it the other way around - this code you've written is reacting to a tag changing. How would the client associate an event that is just "this tag has changed" with any particular window? You must either A: invoke GUI logic from a GUI event or B: make an assumption in your script that "this tag has changed" means that, for instance, 'main window X' is open, and grab it by name.

Are you trying to do this when you open the popup? If so, just place the values you want for the popup's root container into the parameters dictionary of the system.nav.openWindow() call, using keys with the same names as the popup's root container properties.