Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
tree to Navigate
Hello guys!
i have some problems with a tree. I want the tree to navigate me trough my pages.
I added on the left hand side a tree with the following Items
final Tree tree = new Tree();
tree.setImmediate(true);
tree.addItem("Menu");
tree.setChildrenAllowed("Menu",false);
tree.addItem("Shops");
tree.addItem("Shop erstellen");
tree.addItem("Shop löschen");
tree.addItem("Shop übersicht");
tree.setParent("Shop übersicht", "Shops");
tree.setParent("Shop erstellen", "Shops");
tree.setParent("Shop löschen","Shops");
tree.setChildrenAllowed("Shop erstellen",false);
tree.setChildrenAllowed("Shop löschen",false);
tree.setChildrenAllowed("Shop übersicht",false);
tree.addItem("Warenkorb");
tree.setChildrenAllowed("Warenkorb",false);
tree.addItem("Transaktionen");
tree.setChildrenAllowed("Transaktionen",false);
tree.addItem("Reports");
tree.setChildrenAllowed("Reports",false);
tree.addItem("Artikel");
tree.addItem("Artikel einstellen");
tree.addItem("Artikelliste");
tree.addItem("Artikel löschen");
tree.setParent("Artikel einstellen", "Artikel");
tree.setParent("Artikelliste", "Artikel");
tree.setParent("Artikel löschen", "Artikel");
tree.setChildrenAllowed("Artikel löschen",false);
tree.setChildrenAllowed("Artikelliste",false);
tree.setChildrenAllowed("Artikel einstellen",false);
tree.addValueChangeListener(new Tree.ValueChangeListener() {
@Override
public void valueChange(Property.ValueChangeEvent event) {
Object eventValue = event.getProperty().getValue();
if(eventValue==null){
return;
}
switch (eventValue.toString()){
case "Menu":
UI.getCurrent().getNavigator().navigateTo(Views.MAIN);
break;
}}
});
first.addComponent(tree);
as you can see, i want, for example, if i click on Menu that i can navigate to the Main page.
But unfortunately nothing happend
maybe some hints ?
Which version of Vaadin are you using? At least with 7.4.x the value change listener gets triggered correctly. Do you get an exception? Does navigation work, if you manually change the URL?