Vaadin 8.1 RC1 TreeDataProvider, TreeData (getParent, getId), HierarchicalQ

I’m trying te play with TreeGrid at Vaadin 8.1 RC1. I’m trying to migare from HierarchicalContainer to the TreeDataProvider.
But I didn’t get the idea of the new Hierarchial data stucture.
I need just some simple things:

  • Is it possible to get an id of any item of the Hierarchical data? Or new data will not use Ids?
  • is is possible to get parent object of existed object.
    Like

    TreeData.
    MyTreeData;

    MyClass
    myObject;

    MyClass parentItem = MyTreeData.getParent(myObject)

I’ve found some deail related to
HierarchicalQuery

and "
The parent node is available in the

HierarchicalQuery

via the

getParent

method, which returns

for the root level.
" But no examples how to use HierarchicalQuery.

Hi,

I think somebody else already proposed something similar, so having getParent method might be a good idea. Would you
add an enhancement issue
about this?

(At least) Untill that I’d store the hierarchy in your own domain objects, instead of relying on the helper classes of Vaadin.

BTW. Final 8.1.0 is now out.

cheers,
matti

There is
https://github.com/vaadin/framework/issues/9700
and a patch in review providing TreeData.getParent() for the cases using a TreeDataProvider, but an enhancement request for the generic case of any hierarchical data provider would still be welcome.

it will be greate to see this method as (fo my opinion) it one of the base methods to work with TreeData. At this time I will store the hierarchy in my own domain objects.