Opening Multiple Instances of a Popup Window
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.
- In Designer, go to your Tank template. Right click on your Template and scroll down to Scripting.
- 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.
- Save and Publish your project.
- 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.