@Override
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof List) {
List<?> arraysList = ((List<?>) parentElement).stream()
.filter(p -> p instanceof List && !((List<?>) p).isEmpty()).collect(Collectors.toList());
datas = arraysList.toArray();
return arraysList.toArray();
}
return null;
}
getChildren() method is invoked and fill the child node data when a user tries to expand the child node. If I try to expand the child node programmatically before getChildren() get called it's showing the tree like this. So there any idea to initialize the child nodes or call getChildren() programmatically ?
when I call the item.setExpanded(true) to expand the child node and its showing like this
but if i expand any of the 1-9 node from UI it will call the getChildren() method and fill the child data for that specific node for eg: im expanding node 4 here and the next time when i click the searchAction (item.setExpanded(true)) its showing the child node of 4 only because it set data when i expanded from UI i need to set the child node data for all the nodes