Hi, I was searching for the same thing whn i found your post. Did you find a solution in order to know the scroll position?
Thanks Romain On 22 juin, 14:59, Subhrajyoti Moitra <subhrajyo...@gmail.com> wrote: > Hello Folks, > > I am using incubator gen2 ScrollTable. I have a use case, wherein i have to > detect that when the user has scrolled to the last row (or somewhere around > the last row), then load a fresh set of rows in the table, via a rpc call. > TO achieve this i have extented ScrollTable and implemented > HasScrollHandlers. > > public class UbqScrollTable extends ScrollTable implements HasScrollHandlers > { > > public UbqScrollTable(FixedWidthGrid dataTable, > FixedWidthFlexTable headerTable) { > super(dataTable, headerTable); > > } > > public HandlerRegistration addScrollHandler(ScrollHandler handler) { > > return addDomHandler(handler, ScrollEvent.getType()); > } > > } > > And later in some other view i am setting up this table, and the initial > data to go along with it. > When trying to get the scroll position, i do this. st is the scrolltable. > > st.addScrollHandler(new ScrollHandler() { > > public void onScroll(ScrollEvent event) { > int top=event.getRelativeElement().getScrollTop(); > int > scrollHeight=event.getRelativeElement().getScrollHeight(); > int left=event.getRelativeElement().getScrollLeft(); > int width=event.getRelativeElement().getScrollWidth(); > > GWT.log("Scroll data: top: "+top+", scrollHeight: > "+scrollHeight+", y: "+event.getNativeEvent().getScreenY()+", x: > "+event.getNativeEvent().getScreenX()+", left: "+left+", wiodth: "+width+", > class: "+event.getSource().getClass().getName()); > GWT.log("Top: > "+st.getDataTable().getElement().getScrollTop()); > GWT.log("Height: > "+st.getDataTable().getElement().getScrollHeight()); > //st.getElement().setScrollTop(50); > } > }); > > All the values top, height, left, width are all constant and not changing. I > know there is something wrong with my understanding. Please help. > > How do i get the scroll position, or "Detect that the user is viewing the > last few rows of the scroll table" so load new rows from backend? > > Please help. > > Thanks, > Subhro. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.