How would I use GWT to create an infinite scroll panel? -


By infinite scrolling, I mean I initially loads a few widgets, and the user is lazy to scroll it down Fill out to load more.

Any thoughts appreciated.

(ideally should do something for GW 1.6 and 1.5)

Try to do something like this:

 class = "lang-java prettyprint-override">  implements InfiniteScrollPanel to public static class {StringHandler {string text = "email ad server, consectetuer ... "; ScrollPanel Panel = New ScrollPanel (new HTML (text)); Int height = 200; Int width = 200; Public InfiniteScrollPanel () {panel.setHyight (height); Panel.setWidth (width); Panel.addScrollHandler (this); } Scroll to Public Zero (Scroll Event Event) {if (panel.getScrollPosition == height) {panel.add (New HTML (text)); }}}  

What this code does: This creates a ScrollPanel and adds a ScrollHandler to it. ScrollHandler is compared to the height of the panel and then another child Adds to the panel.

I did not test it because I am writing it on the netbook and I do not have an IDE on it.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -