# Perspective - AlarmStatusTable - Visibility on Acknowledge Button Click Event

**URL:** <https://forum.inductiveautomation.com/t/perspective-alarmstatustable-visibility-on-acknowledge-button-click-event/98017>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 31, 2024, 8:12pm UTC](https://forum.inductiveautomation.com/t/perspective-alarmstatustable-visibility-on-acknowledge-button-click-event/98017 "2024-10-31T20:12:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Almond](https://avatars.discourse-cdn.com/v4/letter/d/ea5d25/32.png) [@David\_Almond](https://forum.inductiveautomation.com/u/David_Almond)\
**Post date:** [October 31, 2024, 8:12pm UTC](https://forum.inductiveautomation.com/t/perspective-alarmstatustable-visibility-on-acknowledge-button-click-event/98017/1 "2024-10-31T20:12:43Z")

</div>

Based on what I've read so far I'm thinking the answer is no, but I'm curious if there is any workaround for detecting if the "Acknowledge" button has been clicked on an Alarm Status Table.

We have devices with 'ack' tags as part of their udts and it would be ideal if we could trigger those tags when acknowledged in the Alarm Status Table, rather than performing two independent acks.

I've already solved in one direction (device acknowledge will acknowledge on the Alarm Status Table), but it would be ideal to go in the other direction as well if possible.

---

<div class="post-metadata">

**Author:** ![hunterdg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hunterdg/32/67774_2.png) [@hunterdg](https://forum.inductiveautomation.com/u/hunterdg)\
**Post date:** [April 6, 2025, 12:14pm UTC](https://forum.inductiveautomation.com/t/perspective-alarmstatustable-visibility-on-acknowledge-button-click-event/98017/2 "2025-04-06T12:14:17Z")

</div>

I’d also like the ability to refresh a binding on alarm ack 🙃

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [April 6, 2025, 1:27pm UTC](https://forum.inductiveautomation.com/t/perspective-alarmstatustable-visibility-on-acknowledge-button-click-event/98017/3 "2025-04-06T13:27:55Z")

</div>

> [@David\_Almond](#):
>
> detecting if the "Acknowledge" button has been clicked

Pondering some options...  
I would try to move the PLC write (away from Alarm Table Ack button) to an alarm pipeline that runs any time an alarm is **active & acknowledged**. Might be a dance of race conditions with your existing logic...

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [April 6, 2025, 6:21pm UTC](https://forum.inductiveautomation.com/t/perspective-alarmstatustable-visibility-on-acknowledge-button-click-event/98017/4 "2025-04-06T18:21:42Z")

</div>

I just learned about Alarm event scripts a couple days ago, after posting a question about Ack tags.

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

Could you just perform your binding refresh on the alarm acknowledge event for the relevant tag(s)?

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [April 6, 2025, 10:08pm UTC](https://forum.inductiveautomation.com/t/perspective-alarmstatustable-visibility-on-acknowledge-button-click-event/98017/5 "2025-04-06T22:08:14Z")

</div>

Absolutely **NOT** recommending this as a solution, but you can add events to the acknowledge button using [Periscope's Portal component](https://forum.inductiveautomation.com/t/musson-industrials-embr-periscope-module/99047/20).

This is an example of adding an `onclick` event to the Acknowledge button that sends a message, which a handler responds to by displaying/printed the selected alarms.

Again, **do not do this**. Trying to reset latching control system alarms using Ignition alarm acknowledgement is not a good idea. Just because they both use the word "Alarm" doesn't make them the same thing.

> **View Configuration**
>
> ```python
> {
> "custom": {},
> "params": {},
> "props": {},
> "root": {
> "children": [
> {
> "meta": {
> "name": "Portal"
> },
> "position": {
> "height": 300,
> "width": 300,
> "x": 327,
> "y": 562
> },
> "props": {
> "element": "() \u003d\u003e document.getElementById(\u0027alarmTable\u0027)?.querySelector(\u0027.ackAlarmsButton\u0027)",
> "events": {
> "target": {
> "lifecycle": {
> "onMount": "(target) \u003d\u003e {\n\n target.onclick \u003d () \u003d\u003e {\n\n console.log(\u0027clicked\u0027)\n perspective.sendMessage(\u0027alarmAcked\u0027, {}, \u0027view\u0027)\n }\n\n}"
> }
> }
> }
> },
> "type": "embr.periscope.embedding.portal"
> },
> {
> "meta": {
> "domId": "alarmTable",
> "name": "AlarmStatusTable"
> },
> "position": {
> "height": 380,
> "width": 585,
> "x": 42,
> "y": 53
> },
> "props": {
> "selection": {
> "active": {
> "data": [
> {
> "ackNotes": "",
> "ackPipeline": "",
> "ackTime": "2025-04-06 21:59:08.275+0000",
> "ackUser": "bmusson",
> "activePipeline": "",
> "activeTime": "2025-04-06 21:59:03.703+0000",
> "clearPipeline": "",
> "clearTime": "",
> "deadband": "0.0",
> "displayPath": "Alarms/Alarm/Alarm",
> "eventId": "97d4eb7d-084a-4305-babc-65392a802b34",
> "eventTime": "2025-04-06 21:59:08.275+0000",
> "eventValue": "true",
> "isAcked": "true",
> "isActive": "true",
> "isClear": "false",
> "label": "Alarm",
> "name": "Alarm",
> "notes": "",
> "priority": "Medium",
> "source": "prov:default:/tag:Alarms/Alarm:/alm:Alarm",
> "state": "Active, Acknowledged"
> }
> ]
> }
> }
> },
> "scripts": {
> "customMethods": [],
> "extensionFunctions": [
> {
> "enabled": false,
> "name": "filterAlarm",
> "script": null
> },
> {
> "enabled": false,
> "name": "filterShelvedAlarm",
> "script": null
> }
> ],
> "messageHandlers": [
> {
> "messageType": "alarmAcked",
> "pageScope": false,
> "script": "\tsystem.perspective.print(self.props.selection.active.data)\n\t\n\tself.getSibling(\"Label\").props.text \u003d self.props.selection.active.data",
> "sessionScope": false,
> "viewScope": true
> }
> ]
> },
> "type": "ia.display.alarmstatustable"
> },
> {
> "meta": {
> "name": "Label"
> },
> "position": {
> "height": 32,
> "rotate": {
> "anchor": "25% 25%"
> },
> "width": 50,
> "x": 96,
> "y": 486
> },
> "props": {
> "text": [
> {
> "ackNotes": "",
> "ackPipeline": "",
> "ackTime": "",
> "ackUser": "",
> "activePipeline": "",
> "activeTime": "2025-04-06 21:59:03.703+0000",
> "clearPipeline": "",
> "clearTime": "",
> "deadband": "0.0",
> "displayPath": "Alarms/Alarm/Alarm",
> "eventId": "97d4eb7d-084a-4305-babc-65392a802b34",
> "eventTime": "2025-04-06 21:59:03.703+0000",
> "eventValue": "true",
> "isAcked": "false",
> "isActive": "true",
> "isClear": "false",
> "label": "Alarm",
> "name": "Alarm",
> "notes": "",
> "priority": "Medium",
> "source": "prov:default:/tag:Alarms/Alarm:/alm:Alarm",
> "state": "Active, Unacknowledged"
> }
> ]
> },
> "type": "ia.display.label"
> }
> ],
> "meta": {
> "name": "root"
> },
> "type": "ia.container.coord"
> }
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![hunterdg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hunterdg/32/67774_2.png) [@hunterdg](https://forum.inductiveautomation.com/u/hunterdg)\
**Post date:** [April 7, 2025, 1:40pm UTC](https://forum.inductiveautomation.com/t/perspective-alarmstatustable-visibility-on-acknowledge-button-click-event/98017/6 "2025-04-07T13:40:17Z")

</div>

Way to ease me down that rabbit hole 😆

> [@bmusson](#):
>
> that sends a message

@bmusson - perhaps dumb question - I unsuccessfuly tried to replace the call to `perspective.sendMesssage()` with `perspective.print()`, `util.sendMessage()` and `self.session.refreshBinding()`

function whitelist issue or context issue?

---

<div class="post-metadata">

**Author:** ![hunterdg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hunterdg/32/67774_2.png) [@hunterdg](https://forum.inductiveautomation.com/u/hunterdg)\
**Post date:** [April 7, 2025, 1:44pm UTC](https://forum.inductiveautomation.com/t/perspective-alarmstatustable-visibility-on-acknowledge-button-click-event/98017/7 "2025-04-07T13:44:31Z")

</div>

> [@josborn](#):
>
> Could you just perform your binding refresh on the alarm acknowledge event for the relevant tag(s)?

Yes this would absolutely work, thanks for pointing it out! My use-case doesn’t care which tag is acked though, so adding in the view (once) as opposed to every tag seems a bit more efficient (from development perspective)

I implemented an onClick event on the entire component and check that an alarm has been selected before firing off a message handler. Not perfect (fires more often than necessary), but it works.

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [April 8, 2025, 4:13am UTC](https://forum.inductiveautomation.com/t/perspective-alarmstatustable-visibility-on-acknowledge-button-click-event/98017/8 "2025-04-08T04:13:05Z")

</div>

> [@hunterdg](#):
>
> @bmusson - perhaps dumb question - I unsuccessfuly tried to replace the call to `perspective.sendMesssage()` with `perspective.print()`, `util.sendMessage()` and `self.session.refreshBinding()`
> 
> function whitelist issue or context issue?

The `perspective.sendMessage` function in my example comes from [Periscope's Scripting Globals](https://github.com/mussonindustrial/embr/blob/df1ccbd235e2ae02576a82ddbd2e9d2625229da2/libraries/javascript/perspective-client/src/scripting/ScriptingGlobals.ts):

```typescript
export type CallingContext = {
  client?: ClientStore
  page?: PageStore
  view?: ViewStore
  component?: AbstractUIElementStore
}

export type ScriptingGlobals = {
  perspective: {
    context: CallingContext
    sendMessage: SendMessage
    createView: CreateView
  }
}

```

It's still relatively undocumented. This is JavaScript code running on the client - Ignition's Python scripting does not apply 🙂.

In JavaScript-land, `perspective.print()` would be `console.log()`. And the refreshing of bindings only makes sense from the gateway, so a message handler would be appropriate.
