# Message handler "view" listen scope not working?

**URL:** <https://forum.inductiveautomation.com/t/message-handler-view-listen-scope-not-working/39909>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 22, 2020, 8:42am UTC](https://forum.inductiveautomation.com/t/message-handler-view-listen-scope-not-working/39909 "2020-10-22T08:42:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcarritt1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mcarritt1/32/4262_2.png) [@mcarritt1](https://forum.inductiveautomation.com/u/mcarritt1)\
**Post date:** [October 22, 2020, 8:42am UTC](https://forum.inductiveautomation.com/t/message-handler-view-listen-scope-not-working/39909/1 "2020-10-22T08:42:59Z")

</div>

I noticed that the “view” listen scope doesn’t seem to pickup messages on the same view, I have to set any component message hander to include “page” for it to work.

Example:

A Tree component has a message handler on it with listen scope set to view only.  
A separate button is on the same (coordinate view). No other containers or components exist on the view.  
The button calls the message handler.

It only works if I set the message handler to include ‘page’ that it works.

Am I missing something?

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [October 22, 2020, 2:30pm UTC](https://forum.inductiveautomation.com/t/message-handler-view-listen-scope-not-working/39909/2 "2020-10-22T14:30:17Z")

</div>

You need to specify the scope. By default it uses “page”  
`system.perspective.sendMessage(messageType = "message", scope = "view")`

---

<div class="post-metadata">

**Author:** ![mcarritt1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mcarritt1/32/4262_2.png) [@mcarritt1](https://forum.inductiveautomation.com/u/mcarritt1)\
**Post date:** [October 22, 2020, 2:31pm UTC](https://forum.inductiveautomation.com/t/message-handler-view-listen-scope-not-working/39909/3 "2020-10-22T14:31:47Z")

</div>

oh ha well that makes sense thanks!

---

<div class="post-metadata">

**Author:** ![Bryan\_Fletcher](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bryan_fletcher/32/59158_2.png) [@Bryan\_Fletcher](https://forum.inductiveautomation.com/u/Bryan_Fletcher)\
**Post date:** [March 7, 2024, 5:42am UTC](https://forum.inductiveautomation.com/t/message-handler-view-listen-scope-not-working/39909/4 "2024-03-07T05:42:12Z")

</div>

Just setting the scope did not fix the issue... I had to include the **messageType="message"** param too for it to start working! Thanks for including this example to copy/paste 🙂

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [March 7, 2024, 8:08am UTC](https://forum.inductiveautomation.com/t/message-handler-view-listen-scope-not-working/39909/5 "2024-03-07T08:08:20Z")

</div>

Well, `messageType` is the name of the message to be sent and should match the name of the handler catching it... You can't possibly expect it to work without this parameter !
