Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Persistent error with a JSF custom validator

 
Abhishek Dwaraki
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using a custom validator registered in faces-config.xml. The validate method of the validator is not being called and it is persistently returning null. Could anyone pls tell me y the validate function is not being called...?
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Validators aren't invoked when the control is empty, right? Sometimes to get around that restriction, I see if I can make it a converter instead, because they are invoked even when the user leaves a textfield empty, for example.
 
Abhishek Dwaraki
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help. I did realise that mistake sometime back. But the validate method is not being called even the fields aren't empty. Actually, for that matter, the job of my custom validator is to check whether the field is empty or not and also to restrict it to a certain length and this should be accomplished without using the standard validators. Something of an assignment that's been given to me. Could u pls advice me further....? Thanks in advance.
 
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!