I a m developing a new application based on Vaadin. On one of the screens, there is a gridlayout which contains a set of panels (as CssLayout).
By default, I display 3x3 panels, and I would to add a new feature. If the page is scrolled down, a new set of 3x3 panels is added at the end of the gridlayout, and so on…
I took a look around vadin forums, google, … but I think it’s not supported by default.
From the client-code, be able to send a rpc call (when the scroll is enough down) and so from server-side look for next data for new panels, and add theme to the end of the gridlayout.
You’re exactly right - there’s no support for such functionality in vaadin directly, but it’s quite easy to implement. I’ve implemented such feature in a few projects but don’t have the code at hand right now. If I remember right, an extension was enough to do it for the panel component. Just catch the scroll event, check the scroll position and once it’s at the end, send an event to the server.
Do note that you will most likely need some kind of delay before loading the new stuff, since it’s quite easy for the user to generate a huge amount of scroll events with an accelerated touchpad/scrollwheel.
By extension, Teppo means the Vaadin 7 Extension system where you can add functionality to components without creating a new subclass of that component. Please take a look at
the Extension chapter in Book of Vaadin .
I found some code for the Panel scroll end detection. Disclaimer: it should work but is highly experimental, so please handle with care and do some testing. It probably needs some work.
So I created a separate project as Maven module for this widget.
But I have the following error: Widgetset does not contain implementation for xxx.PanelScrollDetector. Check its component connector’s @Connect mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions.
I guess that it’s a stupid error from me. In my widget project, I have only 3 Java classes, do I have to add MyWidget.gwt.xml file for inside this widget ? and a web.xml file ?
In my main project, I added the Maven dependendy for this widget.
At first try, I included the 3 Java classes for the widget directly inside my project, and I got the same error message.
Or do I have to add something special in my MyProject.gwt.xml