The Problem:
My Webapplication is build of multiple fragments and templates. The Header-Template has a "p:messages" to display application wide erros. In Addtion to that i have a Content-Template to display the content / body.
Now i have the following problem: I want to show content valdiation errors (e.g wrong date selected etc.) under the components in the Content-Template. If i send a facesmessage it won't only be displayed in the message part of the content but also in the header:

At the moment there are only two components which are going to be validated:
<p:calendar id="calendar1" value="#{doesn't matter}">
<f:validateRequired></f:validateRequired>
</p:calendar>
<p:calendar id="calendar2" value="#{doesn't matter}">
<p:ajax event="dateSelect" listener="#{onDateSelect}"
partialSubmit="true" update="ContentMessages"/>
</p:calendar>
The messages tags:
<p:messages id="GlobalMessages" showSummary="true" showDetail="false" closable="true" redisplay="false"/>
<p:messages id="ContentMessages" showDetail="true" autoUpdate="true"/>
How i send the FacesMessage:
FacesContext.getCurrentInstance().addMessage(componentClientId,
new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error:","Error Text"));
What i tried so far:
Use two p:message tags with for="calendar1" and for="calendar2". Still errors in both templates.
Use my "ContentMessages" with a for-tag: for="calendar1 calendar2". Shows errors in the header and not in the content, only if i use a single component id for the for-tag it will show the msg in both templates again.
What i can't do:
- Use globalOnly="true".
- Set the severity for the header only for info and the content for errors & fatals.