Tree as Table of Content


I would like to use a Tree to represent the content (sections and subsections of the shown page). When the user clicks on an item, the panel, containing the document should scroll to that section in the page. The different sections are inserted as different Layout components (so you only need to scroll to the position of the corresponding component).

It should not be difficult to realize this extension, however the scrolling makes this case a bit challenging. At some point I need to execute something like: panel.setScrollTop(componentHeightInPixels). The problem is to determine componentHeightInPixels, the height position in pixels. Vaadin does not seem to be very much willing to reveal the components positions in pixels (and probably has good reason to do so), so how can I scroll to the right position?

The solution seems to be the
size reporter add on
. Though the add on consists of just a single JAR, I can’t manage to add it to my project. I get the following error:

Widgetset 'com.vaadin.DefaultWidgetSet' does not contain implementation for com.ejt.vaadin.sizereporter.SizeReporter. Check its component connector's @Connect mapping, widgetsets GWT module description file and re-compile your widgetsets. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions I tried the following solution: refreshing/cleaning, adding widgetset parameter to web.xml and/or servlet. Without success. The add on inherits com.vaadin.DefaultWidgetSet. What may also cause my problem is that I’m using a GAEVaadinServlet. Also, I don’t have any kind of file like “WidgetSet.gwt.xml” in my project (but there is one in the JAR), maybe there is some setting I need to enable?