# Get exact element location

**URL:** <https://forum.servoy.com/t/get-exact-element-location/15365>\
**Category:** Classic Servoy\
**Created:** [January 17, 2012, 3:06pm UTC](https://forum.servoy.com/t/get-exact-element-location/15365 "2012-01-17T15:06:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karel\_Broer](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@Karel\_Broer](https://forum.servoy.com/u/Karel_Broer)\
**Post date:** [January 17, 2012, 3:06pm UTC](https://forum.servoy.com/t/get-exact-element-location/15365/1 "2012-01-17T15:06:30Z")

</div>

I like to retrieve the exact location / position from an element that has alignment SM\_ALIGNMENT.BOTTOM | SM\_ALIGNMENT.RIGHT.

jForm.getLabel(‘myElement’).y, returns the form location of the element, but when the element is anchored SM\_ALIGNMENT.BOTTOM | SM\_ALIGNMENT.RIGHT, this location should be the position of the element in the window.

Any tips on how to do?

---

<div class="post-metadata">

**Author:** ![Joas](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/joas/32/5095_2.png) [@Joas](https://forum.servoy.com/u/Joas)\
**Post date:** [January 17, 2012, 4:26pm UTC](https://forum.servoy.com/t/get-exact-element-location/15365/2 "2012-01-17T16:26:21Z")

</div>

The position depends on the size of the form in runtime, so you shouldn’t use the solutionModel for this, use the runtime functions instead:

```auto
elements.myElement.getLocationX();
elements.myElement.getLocationY();

```

---

<div class="post-metadata">

**Author:** ![Karel\_Broer](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@Karel\_Broer](https://forum.servoy.com/u/Karel_Broer)\
**Post date:** [January 18, 2012, 10:43am UTC](https://forum.servoy.com/t/get-exact-element-location/15365/3 "2012-01-18T10:43:52Z")

</div>

> Joas:  
> The position depends on the size of the form in runtime, so you shouldn’t use the solutionModel for this, use the runtime functions instead:
> 
> ```auto
> elements.myElement.getLocationX();
> 
> ```

elements.myElement.getLocationY();

> ```auto
> 
> ```

Thanks for the tip Joas, but somehow .getLocationY() allways returns 0 (smartclient), using: ```  
forms[vFormName].elements[vElementName].getLocationY();

```auto
The button is placed in the footer part of a tableview form, btw.
Should I consider this a Servoy issue or is my syntax wrong?

Servoy 6.0.4
Windows 7
```

---

<div class="post-metadata">

**Author:** ![Joas](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/joas/32/5095_2.png) [@Joas](https://forum.servoy.com/u/Joas)\
**Post date:** [January 18, 2012, 12:56pm UTC](https://forum.servoy.com/t/get-exact-element-location/15365/4 "2012-01-18T12:56:19Z")

</div>

Your syntax is correct, so please create a case about this in the [support system](http://servoy.com/s).

---

<div class="post-metadata">

**Author:** ![Karel\_Broer](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@Karel\_Broer](https://forum.servoy.com/u/Karel_Broer)\
**Post date:** [January 18, 2012, 2:10pm UTC](https://forum.servoy.com/t/get-exact-element-location/15365/5 "2012-01-18T14:10:35Z")

</div>

Case SVY-1402 is created for this issue
