addComponentColumn broken with lazy-loading TreeGrid?

Using latest 8.1.x

We have a product tree with nodes and products that I have made lazy-loading by extending a TreeDataProvider and overriding hasChildren/getChildCount/fetchChildren so that they perform a load if they notice the node has not been loaded. Since I only want to put a “add product”-button on rows that are products, I essentially have a addComponentColumn that does (after debugging modifications)

return p.isProduct() ? new Label(“product”) : new Label(“node”);

But for some reason I get “node” listed for product rows also even if a simple System.out.println shows that isProduct returns true. The last child node is also somehow special - if there is only one product in the node it shows “product” correctly but if there are many products the last one is blank (neither “product” or “node”). Or then it gets removed somehow.

Is there something wrong with my TreeDataProvider? In other aspects it works correctly, e.g. normal addColumn(TData::getProductName) shows correctly

Really puzzling :-/

Thanks in advance,

ARTHUR: Yes we seek the answer to this forum post. (clears throat very quietly) Our quest is to find the answer.
ARTHUR: And so we’re looking for it.
KNIGHTS: Yes, we are.
BEDEVERE: We have been for some time.
ROBIN: Months.
ARTHUR: Yes … and obviously any help we get is … is very … helpful.

TreeDataProvider is an in-memory data provider, so it may be possible that some functionalities are not working well when hacked into loading data lazily.

For lazy data loading, it is better to use an implementation of the BackEndHierarchicalDataProvider. One such dummy example is the LazyHierarchicalDataProvider in the uitests package.

It’s difficult to tell what could be wrong from the distance, but it does sound like some of the customizations cause the problems.