# How do I bind a pop up screen and bind it to a specific window

**URL:** <https://forum.inductiveautomation.com/t/how-do-i-bind-a-pop-up-screen-and-bind-it-to-a-specific-window/22553>\
**Category:** Ignition\
**Created:** [February 13, 2019, 7:36pm UTC](https://forum.inductiveautomation.com/t/how-do-i-bind-a-pop-up-screen-and-bind-it-to-a-specific-window/22553 "2019-02-13T19:36:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reksio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/reksio/32/7669_2.png) [@Reksio](https://forum.inductiveautomation.com/u/Reksio)\
**Post date:** [February 13, 2019, 7:36pm UTC](https://forum.inductiveautomation.com/t/how-do-i-bind-a-pop-up-screen-and-bind-it-to-a-specific-window/22553/1 "2019-02-13T19:36:25Z")

</div>

Hi,  
How do I bind an alarm window to a screen, without binding it to any buttons, and make the popup trigger based on a value of the tag?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 13, 2019, 7:53pm UTC](https://forum.inductiveautomation.com/t/how-do-i-bind-a-pop-up-screen-and-bind-it-to-a-specific-window/22553/2 "2019-02-13T19:53:21Z")

</div>

You need to use a [client event script](https://docs.inductiveautomation.com/display/DOC79/Client+and+Gateway+Event+Scripts#ClientandGatewayEventScripts-TagChangeScripts) to watch your tag for changes, then if it’s in alarm ([reading](https://docs.inductiveautomation.com/display/DOC79/system.tag.read) the `AlarmActiveUnackCount` sub-property would work) open your popup window using a [navigation script](https://docs.inductiveautomation.com/display/DOC79/system.nav.openWindow)

---

<div class="post-metadata">

**Author:** ![Reksio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/reksio/32/7669_2.png) [@Reksio](https://forum.inductiveautomation.com/u/Reksio)\
**Post date:** [February 13, 2019, 11:00pm UTC](https://forum.inductiveautomation.com/t/how-do-i-bind-a-pop-up-screen-and-bind-it-to-a-specific-window/22553/3 "2019-02-13T23:00:19Z")

</div>

Hi,  
So im getting the following error when executing a client script:

[client-tagchangescripts-project[project]-3] ERROR TagChangeScriptExecutor - Error executing tag change script: project/MyScript  
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last):  
File “TagChangeScript:project/MyScript”, line 2, in   
AttributeError: ‘com.inductiveautomation.ignition.common.script.Imm’ object has no attribute ‘getHostname’

This is my client event script,

OpenWindow = system.tag.read("[Tagserver]path/PopUpTestBit").value  
Hostname = system.net.getHostname()  
if Hostname == “OneHostName” or Hostname == “OtherHostName” or Hostname == “AnotherHostname” :  
if OpenWindow == 1:  
system.nav.openWindow(“path/path/somewindowname”)  
else:  
system.nav.closeWindow(“path/path/somewindowname”)

Any ideas? It points to the method of getHostname as non existent…

---

<div class="post-metadata">

**Author:** ![mrogers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mrogers/32/4110_2.png) [@mrogers](https://forum.inductiveautomation.com/u/mrogers)\
**Post date:** [February 13, 2019, 11:03pm UTC](https://forum.inductiveautomation.com/t/how-do-i-bind-a-pop-up-screen-and-bind-it-to-a-specific-window/22553/4 "2019-02-13T23:03:28Z")

</div>

Python is case-sensitive - you’re looking for system.net.getHostName()

Edit: By the way, when posting code please surround it (three on the line above, three on the line below) with three ` marks (tilde, not single quote). Its much easier to read.

---

<div class="post-metadata">

**Author:** ![Reksio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/reksio/32/7669_2.png) [@Reksio](https://forum.inductiveautomation.com/u/Reksio)\
**Post date:** [February 14, 2019, 12:51am UTC](https://forum.inductiveautomation.com/t/how-do-i-bind-a-pop-up-screen-and-bind-it-to-a-specific-window/22553/5 "2019-02-14T00:51:00Z")

</div>

Indeed. In the future I will start formatting the posted code .Thank you.

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [February 14, 2019, 10:57am UTC](https://forum.inductiveautomation.com/t/how-do-i-bind-a-pop-up-screen-and-bind-it-to-a-specific-window/22553/6 "2019-02-14T10:57:24Z")

</div>

What we typically do is a create a client BOOL tag called AlarmPopup.  
Then we put a hidden control on a window that is always open(Navigation, Background, etc) that shows the active alarm count.  
On the controls scripting we do a value change script of if newValue \> oldValue and AlarmPopup = True show alarm window.
