The moose likes JSF and the fly likes trying to get another aspect of the rich tree working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "trying to get another aspect of the rich tree working" Watch "trying to get another aspect of the rich tree working" New topic

trying to get another aspect of the rich tree working

Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

I think I am just mis-using some of the elements or attributes. I have looked at tutorials and such but cant seem to figure this one out.
If I understand correctly what I have read, I can first load a list with some xml. I have gotten to this point. I have a list I call ids. When I do this line:

System.out.println("Printing out ids list: "+ids.toString());

it prints out:

I cut out some of the values but as you can see, my list "ids" now holds this xml.

So lets say I want to use deviceId as the roots, and name for the child under each root.

So using the value of ids I have there, it should come out like this:

|---Example Device 1

Just a simple tree right? So how can I do this?

Right now I am doing something else. Right now I am loading my ids list with just the deviceId values, so my list when printed as a string looks like:

printing: [spaces2, exampleDevice1, JSFTEST02]

Now this is very simple to bind to a tree, but I end up with a tree that has three branches and no child nodes.
Playing around with that I get various results, but nothing I am looking for.

So basically, I have a list that is loaded with xml data, and I need to use the deviceId element as the root and the name element as the nodes under the roots.
I know I have read that this is possible, but I cant figure out how to do this.
I have seen an example that used var="items" nodes="#{items.nodes}"
but I cant make any sense of this. I have looked through many tutorials and such and cant seem to get this.

Please help?>

True wisdom is in knowing you know nothing - Socrates
It is sorta covered in the JavaRanch Style Guide.
subject: trying to get another aspect of the rich tree working
Similar Threads
How can I manually add values to ArrayList[]
trouble parsing stream or string into xml
Trying to add string values to a list or some type of collection through iterator
If I use println to print out an input stream value, what should it look like?
Does TreeNode hold multiple values?