# Event Handler for template

**URL:** <https://forum.inductiveautomation.com/t/event-handler-for-template/4575>\
**Category:** Ignition\
**Created:** [June 5, 2012, 2:29pm UTC](https://forum.inductiveautomation.com/t/event-handler-for-template/4575 "2012-06-05T14:29:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [June 5, 2012, 2:29pm UTC](https://forum.inductiveautomation.com/t/event-handler-for-template/4575/1 "2012-06-05T14:29:13Z")

</div>

If I create and Mouse pressed navigation event on my template, sometimes it works when I click, sometimes it doesn’t. I am unable to figure out what I am changing or doing wrong for this…  
The “source” should be the entire template root, correct?  
If i’m clicking on rectangles whether transparent or not… I am still clicking the source, no?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [June 5, 2012, 3:07pm UTC](https://forum.inductiveautomation.com/t/event-handler-for-template/4575/2 "2012-06-05T15:07:33Z")

</div>

That is correct. However, if there is any overlapping components or any components inside the template that take the mouse event it won’t pass through to the template.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 14, 2018, 9:10pm UTC](https://forum.inductiveautomation.com/t/event-handler-for-template/4575/3 "2018-11-14T21:10:43Z")

</div>

This is true, unless you do this:

> [@Template Event Handlers - Events in template and template instance](http://forum.inductiveautomation.com/t/template-event-handlers-events-in-template-and-template-instance/20831/2):
>
> In the mouseClicked event of the template you can dispatch the mouse event to the templates parent. from java.awt.event import MouseEvent evt = MouseEvent( event.source.parent ,event.getID() ,event.getWhen() ,event.getModifiers() ,event.x ,event.y ,event.clickCount ,event.popupTrigger ,event.button) event.source.parent.dispatchEvent(evt)
