Like in normal XHTML/Facelets code, a <f:facet>
can have only one child.
This, as indicated in your code comment,
<f:facet name="header" >
<h:outputText value="Rechercher: "/>
<p:inputText id="globalFilter" onkeyup="examTable.filter();" style="width:200px" />
</f:facet>
is already invalid. It wouldn't have worked in Facelets either. You need to wrap it in a <h:panelGroup>
.
<f:facet name="header" >
<h:panelGroup>
<h:outputText value="Rechercher: "/>
<p:inputText id="globalFilter" onkeyup="examTable.filter();" style="width:200px" />
</h:panelGroup>
</f:facet>
Just do the same in Java code. Remember: there's nothing which can only be done in Java code and not in XHTML, or vice versa. Everything which is possible in Java is also possible using pure XHTML (unlike JSP). Only difference is that XHTML is generally much less verbose and more maintenance friendly in this area.