I have manged to fix this problem partially.

It turns out that my getChildlren methods where hard coded to return
true/false. This in turn triggered a NPE. It seems that if we getChildren
method returns true it means that there has to be some data so not even
empty list will work. 

Creating DefaultTreeModel as such

DefaultTreeModel<ValueWrapper>(encoder, new ValueWrapperAdapter(),
assetGroupRootNode.getChildren());

would require a list to be present and even a empty list will throw a NPE. 

To me this looks like a bug.

I have fixed my code so that inner nodes return appropriate value in
getChildren method and also I only display the list when I have some data in
the list. 

Please not that using the first constructore would not requre for such check
to exist but then I would have one root entry and I dont want that.

I guess this should be reported as bug then? Can someone please try out this
and double check my findings? 

Cheers and thanks everyone for help. 




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/NPE-in-Tree-when-I-dont-have-any-data-tp5720289p5720308.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to