# Message Handler not triggering on component click event

**URL:** <https://forum.inductiveautomation.com/t/message-handler-not-triggering-on-component-click-event/47408>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [June 3, 2021, 2:47pm UTC](https://forum.inductiveautomation.com/t/message-handler-not-triggering-on-component-click-event/47408 "2021-06-03T14:47:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc.Akoto](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/marc.akoto/32/19291_2.png) [@Marc.Akoto](https://forum.inductiveautomation.com/u/Marc.Akoto)\
**Post date:** [June 3, 2021, 2:47pm UTC](https://forum.inductiveautomation.com/t/message-handler-not-triggering-on-component-click-event/47408/1 "2021-06-03T14:47:26Z")

</div>

Ignition 8.1.6 (b2021052512)

Hi, I'm trying to implement component message handlers, refering to this tutorial  
[Component Message Handlers](https://docs.inductiveautomation.com/display/DOC80/Component+Message+Handlers)

Mouse click event on the button:

> system.perspective.sendMessage('my\_handler')

Message Handler on the text area:

> self.props.text="this is a test"

A click on the button should display a specific text in my text\_area.  
But this never happens. I might have missed something simple...

Below is an export of my test project  
[iot\_project\_20210603164103.zip](https://forum.inductiveautomation.com/uploads/short-url/ziBrkEmbeXcSKFMRbw5Ra7u8lAT.zip) (8.5 KB)

---

<div class="post-metadata">

**Author:** ![matthew.ayre](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matthew.ayre/32/19499_2.png) [@matthew.ayre](https://forum.inductiveautomation.com/u/matthew.ayre)\
**Post date:** [June 3, 2021, 2:59pm UTC](https://forum.inductiveautomation.com/t/message-handler-not-triggering-on-component-click-event/47408/2 "2021-06-03T14:59:04Z")

</div>

Hi @Marc.Akoto, main thing to check is the scope for the message. The send will default to page, is this the same for the handler? Also, I assume the handler matches the case, etc. exactly?

I will try and look at your project specifically later (but this will likely be an hour+ 😅)

Using a [logger](https://docs.inductiveautomation.com/display/DOC81/system.util.getLogger) is probably the easiest way to debug where the message is getting stuck.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [June 3, 2021, 3:45pm UTC](https://forum.inductiveautomation.com/t/message-handler-not-triggering-on-component-click-event/47408/3 "2021-06-03T15:45:45Z")

</div>

Your scope is indeed the problem: Your text area is listening on the view scope, but since you have not supplied a scope to the `sendMessage` call it will default to the “page” scope, which is explicitly stated in the documentation and intellihint.  
 ![Screen Shot 2021-06-03 at 8.43.24 AM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/c/3cc706a29e695f2cb08e291c27eb8683c64bd506.png) ![Screen Shot 2021-06-03 at 8.43.41 AM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/0/f0ca6c20637e89ed0de7f0779f4eebd7dee8c79a.png)

Changing the scope in either location to match the scope in the other will get this working.

---

<div class="post-metadata">

**Author:** ![Marc.Akoto](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/marc.akoto/32/19291_2.png) [@Marc.Akoto](https://forum.inductiveautomation.com/u/Marc.Akoto)\
**Post date:** [June 3, 2021, 5:44pm UTC](https://forum.inductiveautomation.com/t/message-handler-not-triggering-on-component-click-event/47408/4 "2021-06-03T17:44:36Z")

</div>

Got it, thanks @cmallonee@matthew.ayre
