Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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

 
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic