Does anybody know how to change the behaviour of JSF component messages such as validator messages, converter messages ? The project iam working on, it allows user to configure the behaviour of (whether a primeface growl message or normal jsf p:message) custom messages with the severity level. We have separate util class to manage it. But we cant find a solution to configure the behaviour of jsf component messages. We want to show them to user according to the way the user has configured it, Eg: if the user wants to see all messages as growl, all messages including jsf component messages should be shown as growl messages. Any idea? We user primeface 4, jee7, java 1.7
update:
This is an enterprise application. We have one <p:growl id="growlMessageId" for="growlMessage" globalOnly="false" sticky="false" autoUpdate="true" redisplay="true" escape="false"/>
and one <p:messages id="messages" globalOnly="false" showDetail="false" autoUpdate="true" closable="true" redisplay="false" escape="false" rendered="#{empty param['showMessageInGlobal'] or param['showMessageInGlobal']}"/>
at header and all pages (more than 50) use these 2 components to show all messages. So other than jsf component error messages we have this util method (part of it) to change the behaviour of the message.
FacesMessage fm = new FacesMessage(messageDescriptor);
fm.setSeverity(this.getFacesMessageSeverity(messageSeverity));
fm.setDetail("");
switch (severityDisplayType) {
case NOTIFICATION:
this.facesContext.addMessage(componentClientId, fm);
break;
case GROWL:
this.facesContext.addMessage("growlMessage", fm);
break;
default:
}
We want to change jsf component messages behaviour same as above. Keeping 2 messages type in every page is not an option