I figured it out by using Document.get().getScrollTop(). I have a lot of API to learn.
On Jun 29, 3:59 pm, Steven Day <[email protected]> wrote: > Hello all, I am relatively new to the gwt programming and I love it, > however I am having a small problem in regards to getting the relative > coordinates inside an absolute panel. I am trying to use Document.get > ().getBodyOffsetTop() to compensate for a scrolling up and down a > page. Here is a snippet of sample code inside an class that extends > AbsolutePanel I am using for testing: > > public class PhalanxWebMapView extends AbsolutePanel { > . > . > . > public void onBrowserEvent(Event event) { > Integer posX = event.getClientX() - this.getAbsoluteLeft() > + > Document.get().getBodyOffsetLeft(); > Integer posY = event.getClientY() - this.getAbsoluteTop() > + > Document.get().getBodyOffsetTop(); > Window.alert( Document.get().getBodyOffsetTop()); // > Testing for > the value > super.onBrowserEvent(event); > } > > } > > When I return the body offset I get a value of 0 no matter how far I > scroll on the page. I've tested this on Firefox 3.5 and Epiphany so > far. Am I using this correctly? > > Thank You, > Steven Day --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
