i have written a jsf validation class and it doesnt seem to be working, my faces.config is configured like this. <validator> <validator-id>validation</validator-id> <validator-class> za.co.fnb.pyramid.validations.Validation </validator-class> </validator>
and call my validator on jsf <hutputText value="First name" /> <h:inputText id="Firstname" value="" required="true"> <f:validator validatorId="validation" value="Firstname"/> <f:attribute name="field" value="Firstname" /> </h:inputText> <h:message errorStyle="color: red" infoStyle="color: green"layout="table" for="Firstname" />
replace ****** with the bean / property expression you want to set
You could also just use a function call to do the validation method instead of registering a validator
Joined: Jan 14, 2005
thanks for your response but how does it find the attribute field since the attribute name needs to be dynamic, so that when i call it from the validation bean it must know which field name to validate.