public Stream<Birimv4> fetchChildren(Birimv4 parent) {
if (parent.getBIRIMUZUNADI() == null) { // beacuse of getting root level
List<Birimv4> newStream = new ArrayList<>();
return newStream.stream();
} else {
Holder<List<Birimv4>> altBirimlerv4 = new Holder<>();
Holder<Result> sonucHolder = new Holder<>();
portv4.getChildNodes(parent.getBIRIM().getKOD().longValue(), altBirimlerv4, sonucHolder);
return altBirimlerv4.value.stream();
}
}
Hi Olli , thanks for reply. i already implemented haschild and count methods based on portv4.getchildnodes method. but that affects query time realy bad and also makes no sense. because for the count calculation i already fetch the data. and fetchchildren again fetchs real data.
and my biggest problem is that root of tree always gets empty. i wrote this
if (parent.getBIRIMUZUNADI() == null) { // beacuse of getting root level
but it seems its not good solution beacuse it gives error some other child nodes.
on short , i have just one method on that service… and it takes an id to load child nodes. any idea for how to pass an id to fetchchild method ?
ps . hierarchicalQuery.getParent() always null on debug. is it ok its null everytime ?
is this the only way to lazily load data for treegrid ? … i remember there was some method to populate data on click event for treetable / something.
edit : i did check it out… it was hierarchical container. and its addItem method made that “lazy load” already.you can add only root items at the beginning to initialize the tree. and then expand listener did the trick.
i realy didnt get the AbstractBackEndHierarchicalDataProvider’s logic.