Hi,
I read this before the post but it doesn't work...
I have on jsp:
<ui:textField binding="#{Page1.textField1}" id="textField1" style="left: 144px; top: 168px; position: absolute"
validator="#{Page1.textField1_validate}" valueChangeListener="#{Page1.textField1_processValueChange}"/>
In the Page1.java
public void textField1_validate(FacesContext context, UIComponent component, Object value) {
CpfValidator cpfvalidate = new CpfValidator();
cpfvalidate.validate(context, component, value);
}
public void textField1_processValueChange(ValueChangeEvent vce) {
CpfValidator cpfValid = new CpfValidator();
if(!cpfValid.confirmaCPF((String)vce.getNewValue())){
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, "ERROR1", "CPF inv\341lido");
throw new ValidatorException(msg);
}
}
But it doesn't validate!
Do you know what is wrong?
thanks