This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF tree view GUI component and tree node actions

Matthias Sonntag
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am a JSF newbie and have a problem with my simple test application.

The application contains a tree view control with one static tree node and a separate text area. Clicking on the tree node shall fill the text area with the string 'hello'. Seems to be very simple, but it doesn't work.

What did I do?
First of all I use the Sun Java Studio Creator 2.
By double clicking on the tree node in the design window of the IDE a method called treeNode1_action() was created. I also added the String text to the session bean. treeNode1_Action() does not more than setting text='hello' ( getSessionBean().setText('hello'); ).
The jsp file contains the line
<ui:textArea binding="#{Page1.textArea}" id="textArea" style="height: 192px; left: 360px; top: 48px; position: absolute; width: 456px" text="#{SessionBean1.text}"/>, so the text of the text area is bound to the session property 'text'.
Running the application and clicking on the tree node does nothing except reloading the page (no 'hello' inside the text area).
Using the debugger showed me that the bean property text is set correctly to 'hello', also after reloading the page.

What did I do wrong?
What do I have to do to display 'hello' in the text area?

I would be glad for some good advice to solve my problem and looking forward for an answer.

Regards from germany
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic