How to select item from Tree?

Hi,

I’m struggling with Vaadin tree to select an item from it!

Even looking at
http://demo.vaadin.com/sampler/#ui/data-presentation/tree
doesn’t help me any further,sorry!

The code:
[code]
mytree.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(final ValueChangeEvent event) {
            final String valueString = String.valueOf(event.getProperty().getValue());
            Notification.show("Value changed:", valueString, Type.TRAY_NOTIFICATION);
         }
    })

[/code]doesn’t seem to work!

I get error like: ValueChangeListener cannot be resolved to a type!

It must be something very basic I’m missing here!

Regards,
Gerard

That sounds like a compilation issue to me. Please make sure your code compiles properly, and if the problem persists, please provide a full stack trace. That will make it easier for us to solve the issue.

It was indeed, I forgot the following import:

import com.vaadin.data.Property.ValueChangeEvent; Now it works!

Regards,
Gerard