I have something like
<g:ScrollPanel>
</g:FocusPanel>
<!-- a few FocusPanels -->
</g:ScrollPanel>
The FocusPanel is attached to a random place within the ScrollPanel. Now I want to get the position of the place where the user places his click. I've tried the following
focusPanel.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
System.out.println(event.getClientX());
System.out.println(event.getX());
System.out.println(event.getRelativeX(event.getRelativeElement().getOffsetLeft()));
System.out.println(event.getRelativeElement().getOffsetLeft());
System.out.println(event.getRelativeElement().getOffsetWidth());
System.out.println(event.getRelativeElement().getOffsetHeight());
System.out.println(event.getRelativeElement().getOffsetTop());
System.out.println(event.getScreenX());
}
}
...but I always get the same values, no matter where I place my click on the focusPanel.