This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSF and the fly likes Very simplified version of rich tree with list data source still giving me a blank page... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Very simplified version of rich tree with list data source still giving me a blank page..." Watch "Very simplified version of rich tree with list data source still giving me a blank page..." New topic
Author

Very simplified version of rich tree with list data source still giving me a blank page...

Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

Instead of using my code that is rife with potential erros, I decided to simplify things to determine if it was just in the way I was binding my list to the rich tree. ANd in its most simplified form I am still getting just a balnk page.

Here is what i did:

First I made a simple class to declare a list, populate it with one entry and have setter and getter:



When I printed out the value of ids it printed out [Test] so it seems the list is getting the value, and should not be null. SO I created a managed bean, and then tried to bind ids to a tree:



But all that does is print out a blank page, just like my other code up there. This is as simple as it can get, so I must be missing something about how to bind this to a treeNode. Can anyone tell me what Im doing wrong?

Im kind of thinking I might need more java code. Maybe something needs to invoke the getter method so it will first add "Test" to the ids list? That is really all I can come up with though.


edit:

I even simplified it a bit further by doing this:






ANd still a blank page. However, I did change nodes="#{nodesBean.ids}" to roots="#{nodesBean.ids}" and I did get a one branch tree with a value of
[I@1486306
Not what I was looking for, but compared to the luck I have had with this it is almost a miracle


True wisdom is in knowing you know nothing - Socrates
Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

I just needed to change nodes="#{nodesBean.ids to roots="#{nodesBean.ids
and also create a void method to do the adding of the values to the list, then call that method in my getIds method and now it works.

On a side note I have never seen the jsf forums so dead (I know I have only been a member since april but still)
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It's the weekend. And it's JSF. The two add up to low traffic.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Very simplified version of rich tree with list data source still giving me a blank page...
 
Similar Threads
rich:tree working now... all the work has finally paid off - THANKS
why isnt this page showing three content panes where I am trying to put them?
Need to call a method to populate my list, then have that list bound to rich tree
having clicking on a treeNode from rich:tree change ui:define content (need help)
What would be best way to handle how clicking on something changes a content pane...