# Creating Event Trigger for individual Widgets in a Perspective Dashboard

**URL:** <https://forum.inductiveautomation.com/t/creating-event-trigger-for-individual-widgets-in-a-perspective-dashboard/99343>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [December 3, 2024, 12:15am UTC](https://forum.inductiveautomation.com/t/creating-event-trigger-for-individual-widgets-in-a-perspective-dashboard/99343 "2024-12-03T00:15:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Caleb\_Warner](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@Caleb\_Warner](https://forum.inductiveautomation.com/u/Caleb_Warner)\
**Post date:** [December 3, 2024, 12:15am UTC](https://forum.inductiveautomation.com/t/creating-event-trigger-for-individual-widgets-in-a-perspective-dashboard/99343/1 "2024-12-03T00:15:10Z")

</div>

I have a Perspective view where I need to provide users the ability to select an individual Widget and trigger a popup with information relevant to that selected object. Is there a way to create a selected parameter within the Widget? (Yellow Highlight) Or is there a way to create an ON CLICK event for a widget when the dashboard is being edited.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/0/30cf194d4b0310c28057c17b074a4397a6afa84c.png)

A good example of what I am hoping to find or have is when you select a row/column of a perspective table you can use/see the selected information. I am hoping to create something similar to this that will allow me to either use Bindings or events to generate a popup to displayed detailed information of the "Bay" selected:

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

Or am I barking up the wrong tree and there's a better way to achieve what I hope to do here?

Any and all engagement is appreciated!

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [December 3, 2024, 1:29am UTC](https://forum.inductiveautomation.com/t/creating-event-trigger-for-individual-widgets-in-a-perspective-dashboard/99343/2 "2024-12-03T01:29:13Z")

</div>

Configure the embedded view to have an `onClick` script that opens the popup with needed information. Have a param like `enablePopup` that your script checks to allow you to enable/disable showing popups when the widget is clicked.

Alternatively, configure the embedded view to have a context menu that has an option for opening the popup.

Since both of these has the embedded view opening the popup, it has all the info it needs to pass to the popup.

---

<div class="post-metadata">

**Author:** ![Caleb\_Warner](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@Caleb\_Warner](https://forum.inductiveautomation.com/u/Caleb_Warner)\
**Post date:** [December 4, 2024, 1:48pm UTC](https://forum.inductiveautomation.com/t/creating-event-trigger-for-individual-widgets-in-a-perspective-dashboard/99343/3 "2024-12-04T13:48:20Z")

</div>

Thanks!

but I must still be missing a step here. I did get everything to work as shown here:  
Widget is selected, but not editing (Blue outline) and popup does not launch.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/4/64711143b54cda20fc6818dc2a47c43c7fe08b6d.png)

When editing the widget (Orange outline) now the popup launches.

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

My hope is to eliminate the 2 button clicks but mainly remove the need to hit the edit GUI icon because you cant see it on half the widgets in use. I understand the enablePopup parameter you suggested, but I still dont see anyway to tie anything to when the individual widget is selected. When I attempt to setup an on click event is applies to the dashboard window as a whole not on components within. I feel like its going to be something obvious but I am not seeing it.

Thanks,

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [December 4, 2024, 1:58pm UTC](https://forum.inductiveautomation.com/t/creating-event-trigger-for-individual-widgets-in-a-perspective-dashboard/99343/4 "2024-12-04T13:58:47Z")

</div>

How about adding a "Dashboard edit" toggle switch to your view.  
Bind the dashboard's `editingToggle` to that.  
You probably also need to turn of `isEditing` when the slider is switched off. I'd do this with a message handler from the toggle's event back to the dashboard.

I haven't tried it so I don't know what other issues might arise.

---

<div class="post-metadata">

**Author:** ![Caleb\_Warner](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@Caleb\_Warner](https://forum.inductiveautomation.com/u/Caleb_Warner)\
**Post date:** [December 4, 2024, 2:09pm UTC](https://forum.inductiveautomation.com/t/creating-event-trigger-for-individual-widgets-in-a-perspective-dashboard/99343/5 "2024-12-04T14:09:43Z")

</div>

Sorry I should have been more concise. by default when the page is loaded I already have the isEditing set to on. The edit button on the widget is what must be clicked to enable the popup as shown here:

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

now its been clicked and the border goes orange:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/3/a3fbad61623197224f5a83074ae1f1d34a67dda2.png)

Doesn't this imply there's a parameter that becomes true when the widget is selected? From there the rest of what I am looking to do is easy.

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

Here is the property table when I have the widget selected and I am editing the individual widget. IE when the popup works.

Thansk,

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 4, 2024, 4:28pm UTC](https://forum.inductiveautomation.com/t/creating-event-trigger-for-individual-widgets-in-a-perspective-dashboard/99343/6 "2024-12-04T16:28:08Z")

</div>

> [@Caleb\_Warner](#):
>
> parameter that becomes true when the widget is selected?

Sure, has to be. In the _ **browser** _. Not necessarily in the gateway where a script would be able to see it. 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![Caleb\_Warner](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@Caleb\_Warner](https://forum.inductiveautomation.com/u/Caleb_Warner)\
**Post date:** [December 4, 2024, 7:31pm UTC](https://forum.inductiveautomation.com/t/creating-event-trigger-for-individual-widgets-in-a-perspective-dashboard/99343/7 "2024-12-04T19:31:40Z")

</div>

Fair enough sounds like this is as good as I am gonna get then.

Thanks for all the assistance!

---

<div class="post-metadata">

**Author:** ![Caleb\_Warner](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@Caleb\_Warner](https://forum.inductiveautomation.com/u/Caleb_Warner)\
**Post date:** [December 4, 2024, 8:04pm UTC](https://forum.inductiveautomation.com/t/creating-event-trigger-for-individual-widgets-in-a-perspective-dashboard/99343/8 "2024-12-04T20:04:53Z")

</div>

Sorry I am really stupid...

Not sure what is happening within the actual dashboard and widget code, but the selected solution works as I was intending if the dashboard is not in edit mode. The reason I didn't try that before was because I didn't think the dashboard would know what specific widget I was selecting when not in edit mode. But that obviously appears to not be the case because I can click on the individual bay areas and get the correct popup information.

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

thanks everyone
