# Cursor xy Location on a template

**URL:** <https://forum.inductiveautomation.com/t/cursor-xy-location-on-a-template/7830>\
**Category:** Ignition\
**Created:** [January 14, 2014, 6:19am UTC](https://forum.inductiveautomation.com/t/cursor-xy-location-on-a-template/7830 "2014-01-14T06:19:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![0sm0](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/0sm0/32/15228_2.png) [@0sm0](https://forum.inductiveautomation.com/u/0sm0)\
**Post date:** [January 14, 2014, 6:19am UTC](https://forum.inductiveautomation.com/t/cursor-xy-location-on-a-template/7830/1 "2014-01-14T06:19:30Z")

</div>

Hi Guys,

Slightly new tweak to an older solved issue \>\> [http://www.inductiveautomation.com/forum/viewtopic.php?f=70&t=10922](http://www.inductiveautomation.com/forum/viewtopic.php?f=70&t=10922)

I have a Popup which contains multiple instances of the same template. The template has a button to call another popup at the cursors location.

Using the code below I can get it working for only 1 instance of the template.

```auto
mouseX = event.x
mouseY = event.y
compX = event.source.getX()
compY = event.source.getY()
parWindow = system.gui.getParentWindow(event)
windowX = parWindow.getX()
windowY = parWindow.getY()

window = system.nav.openWindow("Popups/Popup")

window.setLocation(mouseX+compX+windowX,mouseY+compY+windowY)
```

Is there a way to some how use the unique name of the template instance that the event is occurring in?

```auto
event.source.parent.name
```

gives me the template name but not the instance name…

Cheers for any pointers

Tim…

---

<div class="post-metadata">

**Author:** ![JGJohnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgjohnson/32/29582_2.png) [@JGJohnson](https://forum.inductiveautomation.com/u/JGJohnson)\
**Post date:** [January 14, 2014, 2:53pm UTC](https://forum.inductiveautomation.com/t/cursor-xy-location-on-a-template/7830/2 "2014-01-14T14:53:35Z")

</div>

How about using a custom property on your template? You would have to manually enter a value for this property for each instance in the designer but it would allow you to identify which instance fired the event.

---

<div class="post-metadata">

**Author:** ![0sm0](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/0sm0/32/15228_2.png) [@0sm0](https://forum.inductiveautomation.com/u/0sm0)\
**Post date:** [January 14, 2014, 10:49pm UTC](https://forum.inductiveautomation.com/t/cursor-xy-location-on-a-template/7830/3 "2014-01-14T22:49:45Z")

</div>

Haha, Cheers

Its always the simple things you totally miss…

Works a treat.

Many thanks. ![:thumb_left:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e26afb081ddde6df016df6ee49159cf56aaca688.gif ":thumb\_left:")
