Get position of a component


I want to place a Sub-Window next to a component.

Sub-Windows support to be placed at an absolute position, so the main problem is to get the absolute position of a component.

I can achieve to place a sub-window next to a component by using a LayoutOnClick-Listener, which does return the position of the mouse click and also a relative position (to the clicked component).

Is there a way to get this information
using a LayoutClickEvent? E. g. using a FocusListener and showing up a popup next to the focused TextField?

What is the best practice of getting the position of a component in Vaadin?


I think this is not possible with all events. But I agree such a functionality would be handy in some case. I wonder if anybody has made an add-on to detect the posision of arbitrary component? That should be rather easy, would though need to use asynchronous API, but the latency shouldn’t be an issue in most cases.

If nobody knows about such a helper add-on, I could look into this when I find an hour or two for this.