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.
TreeGrid not expand
TreeGrid<Cliente> treeGrid = new TreeGrid<Cliente>();
provedorCliente = new ProvedorDadosCliente();
HierarchyData<Cliente> data = new HierarchyData<Cliente>();
treeGrid.setDataProvider(new InMemoryHierarchicalDataProvider<Cliente>(data));
InMemoryHierarchicalDataProvider<Cliente> dataProvider = (InMemoryHierarchicalDataProvider<Cliente>) treeGrid
.getDataProvider();
Cliente root = provedorCliente.getListaClientes().get(0);
dataProvider.getData().addItem(null, root);
Cliente c = provedorCliente.getListaClientes().get(1);
Cliente c2 = provedorCliente.getListaClientes().get(2);
root.setSub(new ArrayList<>());
root.getSub().add(c);
root.getSub().add(c2);
dataProvider.getData().addItem(null, provedorCliente.getListaClientes().get(3));
dataProvider.getData().addItems(root, root.getSub());
treeGrid.addColumn(Cliente::getDataVisitaClienteFormatada).setCaption("Data Visita")
.setId("datavisita");
treeGrid.addColumn(Cliente::getCodCliente).setCaption("Cliente").setId("cliente-coluna");
System.out.println(dataProvider.getData().getChildren(root));
treeGrid.setHierarchyColumn("cliente-coluna");
dataProvider.refreshAll();
addComponent(treeGrid);
Just no expand
It is a bit hard to say based on just this code, but maybe the class Cliente does not have suitable equals()/hashCode() implementations.