This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes Rendered property doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Rendered property doubt" Watch "Rendered property doubt" New topic
Author

Rendered property doubt

C Rakesh
Greenhorn

Joined: May 04, 2009
Posts: 18
Friends,

I have an issue with the rendered property.

Please see the code below.

<h:form>
<hutputText value="#{myBean.val1}"/>
<hutputText value="#{myBean.val2}" rendered="#{myBean.renderVal2}"/>
</h:form>

----- code to save val1 and val2------

I want to save val1 and val2 to the database. sometimes I want to save val1 only, sometimes both the values to be saved. If I want to save only val1, I don't want to display val2 inputText so I am using a rendered property to hide val2 inputText.

Now, my issue is, while submitting the form, val1 is populating in the bean myBean the user-entered value for val2 is not populating in the bean myBean. But if remove rendered="#{myBean.renderVal2}", both val1 and val2 are populating into myBean. I don't understand this phenomenon. Please explain me about this.

Rakesh

SCJP 5.0, Preparing for SCWCD
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Rendered property doubt
 
Similar Threads
disabled issue for inputtext
"on page load" in JSF
Accessing Bean from JSP
Editable Data table in request scop JSF2.0
Represent Inheritance of Domain model in JSF