Parameterized Popup Window
A parameterized popup window lets you pass information from one window to another window, where the receiving window would display the relevant information. Also, this allows you to maintain a single window that can be used to display similar information. For example, suppose you have 3 compressors organized in the following folder structure:
Comppressors
C1
HOA
AMPS
C2
HOA
AMPS
C3
HOA
AMPS
The only difference is the compressor number. Imagine clicking on a compressor on your main window and a popup displays the diagnostic information about the compressor. What is passed is simply the number, therefore a single diagnostic window can represent many different compressors.
To pass parameters to the popup window
To pass parameters from one window to another, the receiving window must have Custom properties that receive the passed parameters. These parameters are passed to the receiving window's Custom properties on its Root Container. Once the event on the parent window is called, the parameters are passed to the receiving window's Custom properties on its Root Container. The com ponent's proper ties on the receiving window can use the Root Container's Custom properties to address their bindings.
Let's suppose you have a window called CompressorPopup that you want to use to pass the compressor number to this window.
-
Right-click on the window and select Customizers > Custom Properties.
The Custom Properties window is displayed. -
Specify a Name for the Custom Property, for example name it compNum, and click OK.
The Custom property is now created and displayed at the bottom of the Property Editor.Do not bind these Custom properties to anything, leave them unbound so you can pass values into them without any other values to override them.
-
Use compNum in your tag bindings for the controls on your screen using indirect tag bindings.
For example, you might bind the control and indicator properties of a Multi-State Button to an indirect tag binding like:
Compressors/C{1}/HOA
where the {1} paremeter is bound to the property path: Root Container.compNum
You could use a similar indirect binding to display the amperage in an analog Meter component. -
Now, when opening the window, use a script like the following to open it to control compressor #6. Of course, you probably wouldn't write this script by hand, you'd use the navigation script builder. But it is useful to know what the script would look like.
system.nav.openWindow(
"CompressorPopup"
, {
"compNum"
:
6
})