class TreePanel extends Panel implements Property.ValueChangeListener, Tree.ExpandListener {
public TreePanel() {
tree = new Tree()
tree.addListener(this)
}
void nodeExpand(ExpandEvent event) {
}
void valueChange(ValueChangeEvent event) {
}
}
And I’m getting the following exception:
I am using this in a grails application, so it is groovy code. Curious to know if that has something to do with it because of it’s dynamic nature of things. Otherwise, not sure what is going as as the Tree demo on the vaadin site does something quite similar.
// Add Valuechangelistener and Actionhandler
tree.addListener(this);
You have to cast your parameter because Tree has both addListener(ExpandListener listener) and addListener(ValueChangeListener listener) methods and your class implements these interfaces.
So try
tree.addListener((ValueChangeListener) this);
or
tree.addListener((ExpandListener) this);