wood burning stoves 2.0*
The moose likes JSF and the fly likes having clicking on a treeNode from rich:tree change ui:define content (need help) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "having clicking on a treeNode from rich:tree change ui:define content (need help)" Watch "having clicking on a treeNode from rich:tree change ui:define content (need help)" New topic
Author

having clicking on a treeNode from rich:tree change ui:define content (need help)

Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

I have my tree working and showing ownership (finally), and now I have been trying to get it to change what shows up in my content pane when a node is clicked on. There is only one example I have found and it doesn't fit what Im doing at all.

So I have a page that has a bunch of ui:define areas, most of them are always the same on each page, but the main one is "content" that changes regularly. In my "project_explorer" ui:define area I have a rich:tree like this:



Im not sure how I should handle this. I can change each node there to am h: outputLink instead of h: outputText, and possibly have the page it directs you to populate data depending on which node is selected. That is my idea of how to handle this, but still I need to figure out how to tell my jva code which node is selected.

I started trying to do something very simple, first doing java code that set a String variable to "name":



Then adding doing something like this for the rich:Tree:



all I added to it was nodeSelectListener="#{treeClickBean.selector}" hoping that when that node was clicked on it would invoke the selector method and set nodeTitle to "name"
Then on the jsf pages "content" pane I put:



I figured this was the simplest way to start, hoping that when a node was clicked on the content pane would display "Selected Node: name"

But this didnt happen unfortunately. Ive tried a few different variations but havent had any luck.

So I need some advice on how to handle this. Should clicking on a node send you to a different page altogether, or should I have it change the ui:define "content" area only. Are there any good (simple) samples out there, I really didnt find any.

Any advice at all on this would be great.

BTW here is the entire jsf page so you can see the different ui:define areas if it helps:



True wisdom is in knowing you know nothing - Socrates
Kavita Tipnis
Ranch Hand

Joined: Sep 21, 2008
Posts: 177
Did you take a look at this example which shows a node selected event handler
Richfaces Tree Node Example -> http://livedemo.exadel.com/richfaces-demo/richfaces/tree.jsf?tab=dnd&cid=1884702
Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

Yeah that was what I was using to come up with what I did. I couldn't get anything out of it unfortunately, but I will keep at it and Im sure Ill get that break through eventually
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: having clicking on a treeNode from rich:tree change ui:define content (need help)
 
Similar Threads
What would be best way to handle how clicking on something changes a content pane...
Advice on Object data types to use for the rich:tree I am trying to create
Need my rich:tree to be re loaded when I add a new entity to it
Having issues reRendering a map when a rich:tree node is clicked on(SOLVED)
Problem getting richfaces tree to display