I have a custom tag called "fieldWrapper" to bind labels with their respective inputs and provide validation messages.
The code of the component:
<h:panelGroup id="#{for}CompleteFieldContainer"
styleClass="completeFieldContainer"
layout="block"
rendered="#{rendered}">
<h:panelGroup id="#{for}FieldWithLabelContainer" layout="block"
styleClass="fieldWithLabelContainer #{fieldWrapperBean.getRequiredClass(required)} #{totalSizeClass}">
<c:if test="#{!empty check and check}">
<div class="labelContainer #{labelSizeClass} checkInput">
<ui:insert />
</div>
<div class="labelContainer #{for}LabelContainer checkStyle">
<h:outputLabel for="#{for}" value="#{label}" title="#{title}"/>
</div>
</c:if>
<c:if test="#{empty check or not check}">
<div class="labelContainer #{labelSizeClass} #{for}LabelContainer #{checkStyle}">
<h:outputLabel for="#{for}" value="#{label}" title="#{title}"/>
</div>
<ui:insert />
</c:if>
</h:panelGroup>
<h:panelGroup rendered="#{renderError}" layout="block" styleClass="messageContainer">
<p:message for="#{for}" id="#{for}Message" rendered="true"/>
</h:panelGroup>
</h:panelGroup>
One example of this tag is the following:
<gitags:fieldWrapper for="codeInput"
label="#{msg.code}"
labelSizeClass="size75"
totalSizeClass="size175"
required="false">
<p:inputText id="codeInput"
value="#{clienteFinderManager.codigo}"
styleClass="inputText size100"/>
</gitags:fieldWrapper>
It automatically adds a message for that input, that is rendered when bean validation triggers.
It's working perfectly inside all components except p:tabView.
When I use it inside a tabView messages are queued but not written, but, if i add manually messages after the component they are written:
<gitags:fieldWrapper for="codeInput"
label="#{msg.code}"
labelSizeClass="size75"
totalSizeClass="size175"
required="false">
<p:inputText id="codeInput"
value="#{clienteFinderManager.codigo}"
styleClass="inputText size100"/>
<p:message for="codeInput" id="codeInputMessage" rendered="true"/>
</gitags:fieldWrapper>
Any idea of why is this happening?