When i load the JSF Page i want one of my radiobutton should be checked which property available in JSF

When i load the JSF Page i want  one of my radiobutton should be checked which property available in JSF

is it any cheked property would be available

or i want to use the formbean for that

could you please give me the code
LVL 9
Manikandan ThiagarajanSenior consultantAsked:
Who is Participating?
 
mbonaciConnect With a Mentor Commented:
Bind the "value" attribute of <h:SelectOneRadio> to a property in backing bean and give that property initial value in two ways:
 - in the bean by initializing the property to a value (e.g. private String firstName = "chris";)
 - or you can add managed property to your bean in faces-config, like this:

<managed-bean>
  <managed-bean-name>Userbean</managed-bean-name>
  <managed-bean-class>mb.User</managed-bean-class>
  <managed-bean-scope>request</managed-bean-scope>
  <managed-property>
    <property-name>firstName</property-name>
    <value>chris</value>
  </managed-property>
</managed-bean>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.