edit - now that I think about it, would addChild() be referring to adding a new xml <tag> or the text node within an existing tag? Like I say, this is incomplete, but one thing at a time
edit 1- maybe I should be using TreeNodeImpl Class rather than TreeNode. I thought the TreeNode class was one of the classes i would find at
JBoss but I must have ogtten that somewhere else. SO I guess what this comes down to, is that I need to figure out what class to use that will allow me to append the multiple values that should result from that iterator, which I will then be able to bind to a recursive tree node adaptor
Sorry, like I said I know the code is wrong, I just threw it together to hopefully give an idea of what I meant. It will actually be more like:
Im pretty much declaring a TreeNode value, and then for every device in my device collection, Im trying to add DeviceId to TreeNode x - that is assuming it will hold more than one value. This is from the TreeNode class documentation online:
public void addChild(TreeNode child)
Add a new child node to the end of the list.
So addChild is more accurate than append. But like I said I was just trying to get it posted in time. I guess if there is an addChild method it would suggest TreeNode will hold multiple values though right?
Oh yes and the xml:
Right now when I modify that code from above to say:
It returns
printing attempted iteration thorugh devicecollection: exampleDevice1
If you want a more detailed account of that check this out:
https://coderanch.com/t/447395/Java-General-intermediate/java/If-use-println-print-out
But suffice it to say, I finally have deviceCollection being set to that xml from above like Ive been trying to get it to for days. And now Im needing to loop through deviceColelction and pull out teh text node for each instance of the <deviceId> tag, and then add all those values to a single variable (TreeNode x), which I can then use a gettter for and use tio populate my richfaces tree