I have a form in jsf for which I have created a special validator class that checks if the field is: null, empty, valid, number etc. This class throws an exception with a message if the input is not valid. The problem is that when I write letters in the input field (the input should be an int!) I get the default validation message instead of the custom one. How can I disable the default validation message?
Here is an image with the default validation message:
JSF code:
<h:form>
<h:inputText value="#{deleteEmployeeBean.employeeId}"
id="employeeId" name="employeeId">
<f:validator validatorId="idValidator" for="employeeId"></f:validator>
</h:inputText>
<h:message for="employeeId" style="color: red;"></h:message>
<h:commandButton action="#{deleteEmployeeBean.loadEmployee}"
value="#{content.searchButton}"></h:commandButton>
</h:form>
validatorMessage
attribute ofh:inputText
help? – Selaron