i am using a4j for checking username exists or not for onblur event it displays the error messages when user already exists but ,if i click on submit button after displaying the error message it gets submitted when it comes to the required=true for inputtext it doesn't get submitted
public void checkFirstName(FacesContext facesContext, UIComponent component, Object value)
{
String name = (String) value;
if(name.trim().length()==0){
System.out.println("Name *******");
String message = bundle.getString("Name_Required");
FacesContext.getCurrentInstance().addMessage("Reg:firstName",
new FacesMessage(FacesMessage.SEVERITY_ERROR, message,message));
}
if(name.trim().equalsIgnoreCase("tom")){
String message = bundle.getString("Name_exists");
FacesContext.getCurrentInstance().addMessage("Reg:firstName",
new FacesMessage(FacesMessage.SEVERITY_ERROR, message,message));
}
}
could anyone suggest me where i went wrong