Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

click position within a component

Deleted User
1 decade ago Jan 31, 2010 4:47am

Hi, I am trying to get the mouse click position within an Embedded image for some kind of interactivity.

Vaadin's MouseEventDetails only provide ClientX/Y which are extracted from NativeEvent. That's the mouse position over client browser window. I need to either get component's current position or directly get relative mouse position over the component from the event.

There are lots of threads in the forum talking about component's position, but I didn't see any direct answer.

If develop in GWT, I would get the relative position from MouseEvent which inherits DomEvent. But in Vaadin, the MouseEventDetails is getting information from NativeEvent.

I am trying to build a custom widget in Vaadin but I don't know how to get the relative position from NativeEvent.

Would someone light me up? And it could be great if future Vaadin can provide api for component position.

Last updated on Jan, 31st 2010
Artur Signell
1 decade ago Feb 01, 2010 12:22pm
Deleted User
1 decade ago Feb 01, 2010 4:11pm