• Post Reply Bookmark Topic Watch Topic
  • New Topic

<h:outputFormat displaying null values on page load  RSS feed

 
Dan MacLeod
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a <h:outputFormat that displays the value of a sessionScope variable. The variable is set once a user selects a row from a table. The problem is the value is null before the user selects a row from my table. Is there a way to give a sessionScope variable a default value, or set the <h:outputFormat not to display the 'null' value? I'm using RAD 7.5

thanks
Dan
 
Tim Holloway
Bartender
Posts: 18716
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whether you use RAD or Windows Notepad, the answer is the same. JSF beans are just JavaBeans. To set a default value on a JavaBean, place the default value-setting code in the constructor.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!