# PopUps question

**URL:** <https://forum.inductiveautomation.com/t/popups-question/60713>\
**Category:** Ignition\
**Created:** [June 13, 2022, 7:14pm UTC](https://forum.inductiveautomation.com/t/popups-question/60713 "2022-06-13T19:14:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sean\_Moody](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@Sean\_Moody](https://forum.inductiveautomation.com/u/Sean_Moody)\
**Post date:** [June 13, 2022, 7:14pm UTC](https://forum.inductiveautomation.com/t/popups-question/60713/1 "2022-06-13T19:14:48Z")

</div>

So I currently have a button on a view I have made, and I also have another view that serves as a warning popup. The idea is that the button the user will press will display data on a power chart; however there are times where that data may no be able to be displayed and that is when I want the warning pop up to occur.

I have already created parameters “HasData” that is true or false depending on whether or not data can be displayed and if it is true I would like no warning pop up to show and if it is false I would like that pop up to show upon the button being clicked. However, how would I do this? I cannot find a way under the “On Click” events that I can write a short script to tell ignition to only display the pop up if the “HasData” Parameter is true. Thank you for any help in advance

---

<div class="post-metadata">

**Author:** ![kyler.kamyszek](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@kyler.kamyszek](https://forum.inductiveautomation.com/u/kyler.kamyszek)\
**Post date:** [June 13, 2022, 7:50pm UTC](https://forum.inductiveautomation.com/t/popups-question/60713/2 "2022-06-13T19:50:45Z")

</div>

Use Message Handlers.

The button will run a script that throws an event. The root of the page will have a message handler to catch the event.

You can then have the message handler eventually use system.perspective.openPopup.

Here’s a small example. ‘prmTxtPrompt’ would be a parameter in the popUpView view.

```auto

vwName = 'popUpView'
params = { 'prmTxtPrompt':msg }
title = 'RECIPE ERROR' if (error) else 'RECIPE'
logMessage('info', title, msg)
system.perspective.openPopup('puStatus', vwName, params, title)

```
