# 8.0.13 closePopup() not working

**URL:** <https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626>\
**Category:** Ignition Early Access\
**Created:** [June 14, 2020, 3:28am UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626 "2020-06-14T03:28:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![danieltalbot](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/danieltalbot/32/11201_2.png) [@danieltalbot](https://forum.inductiveautomation.com/u/danieltalbot)\
**Post date:** [June 14, 2020, 3:28am UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/1 "2020-06-14T03:28:07Z")

</div>

Just upgraded to 8.0.13 tonight. Have the weekend to figure out any bugs. Right away noticed that close buttons no longer work on popup views.

Have multiple popups using custom close buttons - some using the popup event and some using the system.perspective.closePopup() function. I’m using the correct identifier in each case and none of the buttons are closing the popups. togglePopup() doesn’t work for me either. These buttons worked in 8.0.12.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [June 14, 2020, 4:09am UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/2 "2020-06-14T04:09:34Z")

</div>

There was a bug in 8.0.12 where if `closePopup()` (and/or `togglePopup()` ) was called but the id specified did not match any open Popup, Perspective just indiscriminately closed the most recently focused Popup. We fixed that issue in 8.0.13, so I would examine the Popup being opened and make sure that closePopup is specifying the correct id. If you want to continue using the caution-to-the-wind approach, you can provide an empty string for the id argument in order to mimic the 8.0.12 behavior:

```auto
system.perspective.closePopup(id='')

```

To be clear, this is not a bug in 8.0.13; you happen to be using a bug in 8.0.12 and probably assumed it was working as intended up until now - as did many people.

---

<div class="post-metadata">

**Author:** ![mmurphy](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmurphy/32/11430_2.png) [@mmurphy](https://forum.inductiveautomation.com/u/mmurphy)\
**Post date:** [June 20, 2020, 1:12pm UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/3 "2020-06-20T13:12:53Z")

</div>

**UPDATE** : Never mind, I figured it out. I have to update the “Identifier” text box with the ID used when opening the popup.

* * *

@cmallonee In 8.0.12, I configured a popup to serve as a message box of sorts. When the user pressed a “Submit” button, an INSERT query ran and a popup came up showing the RecordID of the row the user just inserted into SQL. That popup was just a label and an “OK” button. On the “onActionPerformed” event of the “OK” button, I configured a popup event to close itself. That is now not working.

From your response, I gather I somehow need to point the Close command to a specific instance of the popup view? How can I do that?

![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/4b9a9e03fc3e3e8c5cf61e93531d0e385b5717fa.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/ba66f68d0977900fb3734f82d4467c63c6ef9233.png)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [June 20, 2020, 3:02pm UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/4 "2020-06-20T15:02:07Z")

</div>

> [@mmurphy](#):
>
> Never mind, I figured it out. I have to update the “Identifier” text box with the ID used when opening the popup.

Correct. This had always been required for targeting Popups to close in a Session; it just didn't work correctly before 8.0.13. If you find that you have to allocate Popup IDs dynamically, you also have the option of translating your Popup Action into a Script Action and invoking `system.perspective.openPopup()` (or `closePopup()` ).

---

<div class="post-metadata">

**Author:** ![iscrac](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/iscrac/32/49757_2.png) [@iscrac](https://forum.inductiveautomation.com/u/iscrac)\
**Post date:** [August 27, 2020, 11:10am UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/5 "2020-08-27T11:10:22Z")

</div>

I use 8.0.15 version of Ignition.  
The function system.perspective.closePopup() doesn’t work for me…  
It worked it earlier versions… but after the update it doesn’t  
Can anyone help me with that?

And… icon’s shape strokes work strange…  
it looks like that:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/a/2a5729af45ee8f33f06e6b00f39f9ca5c46e44b5.png)

but it should look that way:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/3/63d80f8f4100cd7b00c7b888fa66f75ad43e7684.png)

---

<div class="post-metadata">

**Author:** ![danieltalbot](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/danieltalbot/32/11201_2.png) [@danieltalbot](https://forum.inductiveautomation.com/u/danieltalbot)\
**Post date:** [August 27, 2020, 2:52pm UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/6 "2020-08-27T14:52:07Z")

</div>

You can either use system.perspective.closePopup(’’) using quotes inside the parentheses, or use the name of the popup, as specified in your call to system.perspective.openPopup(‘name’, ‘viewpath’)

---

<div class="post-metadata">

**Author:** ![iscrac](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/iscrac/32/49757_2.png) [@iscrac](https://forum.inductiveautomation.com/u/iscrac)\
**Post date:** [August 28, 2020, 5:49am UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/7 "2020-08-28T05:49:37Z")

</div>

> [@danieltalbot](#):
>
> You can either use system.perspective.closePopup(’’) using quotes inside the parentheses

I do that! It worked in earlier versions of Ignition.

In log file when I'm trying to close PopUp, I get this message:

> Received event for missing view "PopUps/ActiveAlarms@P3NaWtTac"

what is this **@P3NaWtTac**?

and when I save project, I get this:

> View 'PopUps/ActiveAlarms@P3NaWtTac' restarted but missing from session.

🥴

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 28, 2020, 12:05pm UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/8 "2020-08-28T12:05:10Z")

</div>

> [@iscrac](#):
>
> It worked in earlier versions of Ignition.

Yes, but if you read the solution for this thread, you'll see why it no longer works like you originally had it.

`@P3NaWtTac` Is the name of a View in memory. You're most likely seeing this message because the View has some sort of Event thread running on the Gateway (like a binding or Message Handler) which is attempting to the update the View after it has been closed. It's benign logging.

---

<div class="post-metadata">

**Author:** ![iscrac](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/iscrac/32/49757_2.png) [@iscrac](https://forum.inductiveautomation.com/u/iscrac)\
**Post date:** [August 28, 2020, 12:16pm UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/9 "2020-08-28T12:16:26Z")

</div>

> [@cmallonee](#):
>
> Yes, but if you read the solution for this thread

omg. sorry. I was not so attentive.

but do You know waht happend with shape stroke property?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 28, 2020, 12:18pm UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/10 "2020-08-28T12:18:59Z")

</div>

Please ask that question in a different thread so that this thread is not hijacked.

---

<div class="post-metadata">

**Author:** ![iscrac](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/iscrac/32/49757_2.png) [@iscrac](https://forum.inductiveautomation.com/u/iscrac)\
**Post date:** [September 16, 2020, 8:45am UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/11 "2020-09-16T08:45:08Z")

</div>

Hi there,

I use 8.0.16 version of Ignition

I have one question:

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/a/3ae5dcd9d51aa37b9d6597d6ab13784662961705.png)  
I have a popup configured with 2 buttons on it:

1. When You press “JAH”, then the entered data have to be set into special tag (it’s working. don’t worry)
2. When You press “EI”, the PopUp have to be closed without any manipulations…  
so… the second button does not closing… why??  
I use the same script for close the popup:

```auto
system.perspective.closePopup('')

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/6/862513891b0ffdad5a573dd0c64c3818838d4661.png)

🥴

---

<div class="post-metadata">

**Author:** ![quper](https://avatars.discourse-cdn.com/v4/letter/q/aeb1de/32.png) [@quper](https://forum.inductiveautomation.com/u/quper)\
**Post date:** [September 16, 2020, 1:21pm UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/12 "2020-09-16T13:21:36Z")

</div>

Tervist!

You should put your script under “Events”, not under “Scripts”:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/b/ab9abfcaa22edc4abe6faad7df81beb9987ba71a.png)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [September 16, 2020, 4:00pm UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/13 "2020-09-16T16:00:04Z")

</div>

I don’t know why you put that script into a custom function, but it doesn’t belong there; it belongs in a Script Action invoked as part of an Event triggered by the Button, as @quper posted. That posted Event/Action combo is correct, and is part of the Button - not the `root`.

---

<div class="post-metadata">

**Author:** ![iscrac](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/iscrac/32/49757_2.png) [@iscrac](https://forum.inductiveautomation.com/u/iscrac)\
**Post date:** [September 16, 2020, 5:24pm UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/14 "2020-09-16T17:24:40Z")

</div>

> [@cmallonee](#):
>
> I don’t know why you put that script into a custom function, but it doesn’t belong there; it belongs in a Script Action invoked as part of an Event triggered by the Button, as @quper posted. That posted Event/Action combo is correct, and is part of the Button - not the `root` .

because it was on Button Events, but it did not work, so I decided to put this function into root scripts...

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [September 16, 2020, 5:32pm UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/15 "2020-09-16T17:32:55Z")

</div>

Please provide a screenshot of the script in the appropriate location and then we’ll work to see why it’s supposedly not working for you. Have you specified an id for the Popup? An id is not required to get this working, but it helps us to diagnose and/or help with the issue. Does the Page have more than one Popup open?

---

<div class="post-metadata">

**Author:** ![iscrac](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/iscrac/32/49757_2.png) [@iscrac](https://forum.inductiveautomation.com/u/iscrac)\
**Post date:** [September 16, 2020, 5:50pm UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/16 "2020-09-16T17:50:40Z")

</div>

> [@cmallonee](#):
>
> Please provide a screenshot of the script in the appropriate location and then we’ll work to see why it’s supposedly not working for you.

"JAH" button Event onClick:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/9/f94bea35acce5c37dd3f6028f940b8e786260820.png)

"EI" button Event onClick:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/1/217126dc1b3691a9a2ca7c3a6614459d16f3ac32.png)

I open only one popup here on the page  
page does not have page ID...

You know...  
We have another Project - the copy of current... and there this PopUp works fine... scripts and windows are the same... these projects located on different Servers  
🥴

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [September 16, 2020, 5:52pm UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/17 "2020-09-16T17:52:29Z")

</div>

You are NOT using the same script in both buttons; one is passing an empty String and one is not. BOTH should pass the empty String.

---

<div class="post-metadata">

**Author:** ![iscrac](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/iscrac/32/49757_2.png) [@iscrac](https://forum.inductiveautomation.com/u/iscrac)\
**Post date:** [September 16, 2020, 5:54pm UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/18 "2020-09-16T17:54:13Z")

</div>

😳  
omg… I need some rest…  
thanx!  
stupid mistake 😑  
sorry for taking Your time…

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [March 2, 2021, 3:15pm UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/19 "2021-03-02T15:15:22Z")

</div>

Hello there, digging this up for pretty much the same problem.

Here’s the situation:  
I have a dock with a button, that when clicked (onClick script) opens a popup with

```auto
system.perspective.openPopup("tcu_selection", "PopUp/TcuSelection", title="Select a TCU", params={'site_id': 1}, modal=True, overlayDismiss=True)

```

The `PopUp/TcuSelection` view has a button, which should close the popup when clicked. It has this code as onClick script:

```auto
self.perspective.closePopup("tcu_selection")

```

But you guessed it, the popup won’t close this way. It closes fine when clicking the `x` button or outside of the popup, but that script line has no effect whatsoever, except crashing the script and skipping the rest of the code if I put anything after it.  
I tried with and without the popup id, replacing it with just `""`, but no dice.  
I’m kinda guessing that it has something to do with the optional pageId parameter to the function… But I don’t even know if I’m on the right track, and I cannot figure out how to get out of this.

Any clue ?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [March 2, 2021, 3:42pm UTC](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626/20 "2021-03-02T15:42:59Z")

</div>

If you look at your Gateway logs you’ll see that the closePopup call is failing because the script object has no attribute “perspective”. Replace `self` with `system` and you’re good-to-go.

Essentially, you want to use a “system” function, but you’re trying to use it as if it belongs to the script (“self” would refer to the script in this usage).

[Next page](https://forum.inductiveautomation.com/t/8-0-13-closepopup-not-working/35626.md?page=2)
