hierarchical container iteration


The getIdByIndex(i) method doesn’t work for hierarchical containers, so I’m not sure how to iterate over it…

I’m try this with a treetable (tree):

 for (int i = 0; i < tree.getContainerDataSource().size(); i++) {

                Item item = tree.getContainerDataSource().getItem(tree.getContainerDataSource().getItemIds());
                Object value =item.getItemProperty(PROPERTY).getValue();


…but it gives me a null pointer exception error…I’m not sure how to fix this…any idea??

regards and ,as always, thank you very much…

ps.- I posted this comment in another thread and tried to erase it, but it didn’t work, sorry about that…

any idea on this???

you can get item by getItemProperty
see example below:

   for (int i = 1; i <= treeT.getContainerDataSource().size(); i++) 
	// you can get item like this.
	String name = treeT.getContainerDataSource().getItem(i).getItemProperty("Type A").toString();