• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Rendered property doubt

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Friends,

I have an issue with the rendered property.

Please see the code below.

<h:form>
<h:outputText value="#{myBean.val1}"/>
<h:outputText 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic