# Perspective Max popups

**URL:** <https://forum.inductiveautomation.com/t/perspective-max-popups/60116>\
**Category:** Ignition\
**Tags:** ignition81, vision, perspective\
**Created:** [May 27, 2022, 11:18am UTC](https://forum.inductiveautomation.com/t/perspective-max-popups/60116 "2022-05-27T11:18:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Hunt](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Matthew\_Hunt](https://forum.inductiveautomation.com/u/Matthew_Hunt)\
**Post date:** [May 27, 2022, 11:18am UTC](https://forum.inductiveautomation.com/t/perspective-max-popups/60116/1 "2022-05-27T11:18:34Z")

</div>

Hello,

Is it possible to make it so that a popup window closes the previous opened popup if you open a new one? I wish to create a process overview with component data where if you click on a component, a popup opens at a set X and Y coordinate. This works well already but I noticed that if you open the popup for multiple components the previous ones stay open which seems un-necessary for this form of application.

Is there a way to either “overwrite” the opened popup or to close all other popups when opening a new one? What would be the best way to solve this in that case.

This is for Perspective by the way and not vision.

---

<div class="post-metadata">

**Author:** ![djs](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@djs](https://forum.inductiveautomation.com/u/djs)\
**Post date:** [May 27, 2022, 11:57am UTC](https://forum.inductiveautomation.com/t/perspective-max-popups/60116/2 "2022-05-27T11:57:06Z")

</div>

If all your popups for that component have the same _id_, I’m pretty sure you could just run 2 events. The first one closes the popup, the second one opens the same popup. That way if there is a popup open already with that _id_, it will close first, and then you would be able to open your new popup.

---

<div class="post-metadata">

**Author:** ![djs](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@djs](https://forum.inductiveautomation.com/u/djs)\
**Post date:** [May 27, 2022, 12:02pm UTC](https://forum.inductiveautomation.com/t/perspective-max-popups/60116/4 "2022-05-27T12:02:42Z")

</div>

Another option is for the popups to have a messageHandler that closes them. Then in your button that opens a new popup, you first send a message which will close all the popups, and then open your new one.

---

<div class="post-metadata">

**Author:** ![Matthew\_Hunt](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Matthew\_Hunt](https://forum.inductiveautomation.com/u/Matthew_Hunt)\
**Post date:** [May 27, 2022, 12:05pm UTC](https://forum.inductiveautomation.com/t/perspective-max-popups/60116/5 "2022-05-27T12:05:58Z")

</div>

I tried this solution and will probably use it. It seems to work pretty well for my use.

I put a “Close” popup event on the button down and an “Open” popup event on the OnClick where I pass parameters in the Open and pass nothing except for the same ID in the Close. Works well enough for what I need!  
I tried having both the close and open event on the same Event Action but it did not work as intended so I think I will go with the OnClick and MouseDown events.

Thanks for the help Daniel!
