Override Omnifaces validation message with JSF message package?

Is it possible to override the default validation messages with the jsf message package?

my message-bundle:

javax.faces.converter.DateTimeConverter.DATE={2}: ''{0}'' could not be understood as a date. javax.faces.converter.DateTimeConverter.DATE_detail=Invalid date format. javax.faces.validator.LengthValidator.MINIMUM=Minimum length of ''{0}'' is required. org.omnifaces.component.validator.ValidateUnique=1. my validateUnique omnifaces msg, {0} org.omnifaces.component.validator.ValidateUnique.DEFAULT_MESSAGE=2. my validateUnique omnifaces msg, {0} 

I know there is a 'message' attribute, but it would be nice to have all the messages in one place.

thank you very much in advance

+6
source share
1 answer

This is currently not supported by OmniFaces authentication components. As you can see in the source code of ValidateMultipleFields#showMessage() , it never gets the default message from the message package identified by Application#getMessageBundle() .

I reported the question so that the OmniFaces guys were noticed about this and could implement it for the next version. At the same time, it is best to use the message attribute. You can reorganize code duplication into a custom tag file if necessary.

+3
source

Source: https://habr.com/ru/post/970694/


All Articles