<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:p="http://primefaces.org/ui">
    
    <!-- 
        Composant champ de recherche texte avec AJAX réutilisable (WOU/DRY)
        Usage: <ui:include src="/templates/components/forms/form-field-search-text.xhtml">
                  <ui:param name="id" value="searchNom" />
                  <ui:param name="label" value="Nom" />
                  <ui:param name="value" value="#{bean.filtres.nom}" />
                  <ui:param name="placeholder" value="Rechercher par nom..." />
                  <ui:param name="update" value=":formResultats:dtResultats @(.search-summary)" />
                  <ui:param name="event" value="keyup" />
                </ui:include>
        event: keyup, change, blur
    -->
    
    <div class="field">
        <p:outputLabel for="#{id}" value="#{label}" />
        <p:inputText id="#{id}" 
                     value="#{value}" 
                     placeholder="#{placeholder}"
                     styleClass="w-full">
            <p:ajax event="#{not empty event ? event : 'keyup'}" 
                   update="#{not empty update ? update : ':formResultats:dtResultats @(.search-summary)'}" />
        </p:inputText>
    </div>
</ui:composition>

