Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Render Problem

 
udaya krishna
Ranch Hand
Posts: 65
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I have a problem regarding render in JSF. I have created two radio buttons "Enable" and "Disable" and a textbox.I have written the validation for the text box using required="true" attribute so that that textbox cannot be empty.My question is that is it possible such that validation happens only if "enable" radio button is selected? when "Disable" is selected validation should not happen.I have already used render for the input text box.so i cannot use render again for validation.Any suggestions?

Thanks
 
udaya krishna
Ranch Hand
Posts: 65
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And the reason i am asking for it is that if the user enters say 0 in the textbox and then he selects "Disable" button i am still getting the validation error message(I have a validation such that the value in the textbox cannot be 0) .
Thanks
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18167
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid that view-level validation is unconditional. Conditional validation is something that the action handler method must do. The only other way would be to create a complex custom validator, and that's rarely worth it.
 
udaya krishna
Ranch Hand
Posts: 65
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm..thanks tim..i do have some custom validators written in my project.will try it..meanwhile if any other suggestions are available i would like to know
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic