Skip to main content
Version: 7.9

Popup Window - Multiple Instances

Inductive University

Popup Window - Multiple Instances

Watch the video

By default, Ignition only opens a single instance or copy of a popup window in the client at a time. However, you can change this behavior and open multiple instances of a popup window in the client.

In this example, suppose you have four tanks in your client. If you click on any one of the four tanks, you will get a popup window that gives you some additional information about that tank.

If you click on another tank, for example Tank 101, the popup window switches to Tank 101, but there are still three windows open: Navigation window, Main window, and a Popup window (use the Windows Menubar at the top of the screen to view all open windows in the Client). What happens is when clicking on a different tank reopens the popup window and passes in new parameters. This is the default behavior because the number of open windows you can have at one time is limited in the client. You can change this behavior and have multiple instances of the same window open at once using a script.

Popup Window - Multiple Instances

Opening Multiple Instances of a Popup Window

note

This example expands on the tank example from the Parameterized Popup Window and UDTs page.

Opening a window will only ever open one copy of any given window. If a popup window is already open, it simply brings it to the front. Sometimes you may want to open a separate popup, one for Tank 100, and one for Tank 101, both at the same time. If this is the case, you can use the system.nav.openWindowInstance function call to open your window.

  1. In Designer, go to your Tank template. Right click on your Template and scroll down to Scripting.

    Opening Multiple Instances of a Popup Window Step 1

  2. You'll notice that the Navigation tab settings are set to Open/Swap and are passing some Tank parameters over to the popup window. Check the Additional Instance box to make the script open up additional instances of your popup windows. When you click on the Additional Instance box, Ignition automatically enables the navigation script builder. It also tells the script instead of using the same popup window, to open up a new instance if there is another popup window already open instead of switching it out (to view the script, click on the Script Editor tab. You'll notice the system.nav.openWindowInstance function is used). Click OK.

    Opening Multiple Instances of a Popup Window Step 2

  3. Save and Publish your project.

  4. Open your Client, or if you already have it open, update the client by clicking the yellow bar. Click on each of your Tanks, and you'll see multiple instances of the same popup for each different tank.

Opening Multiple Instances of a Popup Window Step 4