This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

h:selectBooleanCheckbox required validation

 
ya ji
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to validate required for h:selectBooleanCheckbox?

Code:
<h:selectBooleanCheckbox label="User Group" required="true" id="selusergroups" value="#{UserBean.ugSelection[usergroup]}" />

it's now working.
 
Bhaskar GR
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to generate validation in backing bean
 
ya ji
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bhaskar,

Could you give me some idea about that or provide some sample code? thanks,I'm a freshman of JSF
 
Venkat Sadasivam
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the kind of validation are you expecting in boolean check box?

As I understand it has only two condition either checked or unchecked. I feel there is no validation is required for boolean check box.
 
ya ji
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A checkbox group, validate at least one checkbox checked.
 
Venkat Sadasivam
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case you have to use <h:selectManyCheckbox />
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic