Search code examples
jsfprimefacesconvertersmessage

Primefaces - Intercept error message, and show my own


I have an input field, <p:inputText>. Im setting the data to a long attribute. If I write a something else than a letter, then im getting an error message on my <p:messages>.

This is behavior that I want.

But is it possible to intercept the message, and print my own insted?


Solution

  • <p:inputText> has attribute for it validatorMessage="" or requiredMessage=""(required message is displayed if field is required but not filled) if your error appear in converter you can also use converterMessage=""

    ps. Feel free to use localized strings in it.