# Pop-up tied to toggle push button

**URL:** <https://forum.inductiveautomation.com/t/pop-up-tied-to-toggle-push-button/45072>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [March 30, 2021, 6:11pm UTC](https://forum.inductiveautomation.com/t/pop-up-tied-to-toggle-push-button/45072 "2021-03-30T18:11:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rrebro](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@rrebro](https://forum.inductiveautomation.com/u/rrebro)\
**Post date:** [March 30, 2021, 6:11pm UTC](https://forum.inductiveautomation.com/t/pop-up-tied-to-toggle-push-button/45072/1 "2021-03-30T18:11:00Z")

</div>

I would like a button that opens a popup. Basically like a dropdown that displays a popup window. My solution is to take a Toggle Button and when the property changes check if the button is pressed, if it is open the popup, if it’s not close the popup. For the most part this works but what I am running into is I want the popup, if open, to close if I switch screens.

---

<div class="post-metadata">

**Author:** ![TimE](https://avatars.discourse-cdn.com/v4/letter/t/ee59a6/32.png) [@TimE](https://forum.inductiveautomation.com/u/TimE)\
**Post date:** [March 31, 2021, 4:55am UTC](https://forum.inductiveautomation.com/t/pop-up-tied-to-toggle-push-button/45072/2 "2021-03-31T04:55:32Z")

</div>

What are the events that change windows? Depending on on how you implement your navigation you can detect this and close the windows you desire.

---

<div class="post-metadata">

**Author:** ![rrebro](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@rrebro](https://forum.inductiveautomation.com/u/rrebro)\
**Post date:** [March 31, 2021, 1:17pm UTC](https://forum.inductiveautomation.com/t/pop-up-tied-to-toggle-push-button/45072/3 "2021-03-31T13:17:35Z")

</div>

I’m swapping windows. My other thought was to ditch the popup and just have the button hide or show the contents from that popup window.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [March 31, 2021, 1:23pm UTC](https://forum.inductiveautomation.com/t/pop-up-tied-to-toggle-push-button/45072/4 "2021-03-31T13:23:55Z")

</div>

I don’t know if you need to be allowed to move a popup, but you could just always make this “popup” as another container within the window, and tie the visibility property of the container to the selected property of the toggle button. I do this. You won’t be able to move the container around, but otherwise it looks and feels like a popup.

This also makes it easier for the parent window to get the data from the container instead of passing data from one window to another.

---

<div class="post-metadata">

**Author:** ![rrebro](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@rrebro](https://forum.inductiveautomation.com/u/rrebro)\
**Post date:** [March 31, 2021, 1:36pm UTC](https://forum.inductiveautomation.com/t/pop-up-tied-to-toggle-push-button/45072/5 "2021-03-31T13:36:22Z")

</div>

Exactly what I was thinking, I’ll give this a try.

---

<div class="post-metadata">

**Author:** ![rrebro](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@rrebro](https://forum.inductiveautomation.com/u/rrebro)\
**Post date:** [March 31, 2021, 2:43pm UTC](https://forum.inductiveautomation.com/t/pop-up-tied-to-toggle-push-button/45072/6 "2021-03-31T14:43:43Z")

</div>

This seems to work out nicely, I wanted to make it such that when the drop down popup is out and I switch screen that when I come back to the screen the popup is closed. I made the popup close if a property change occurs, as far as I know there is no issue with doing this but I would’ve liked a way to actually detect when the window closes and change the state of the button to close the popup.
