<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 autoComplete réutilisable (WOU/DRY)
        Usage: <ui:include src="/templates/components/forms/form-field-autocomplete.xhtml">
                  <ui:param name="id" value="searchProfession" />
                  <ui:param name="label" value="Profession" />
                  <ui:param name="value" value="#{bean.filtres.profession}" />
                  <ui:param name="completeMethod" value="#{bean.completerProfessions}" />
                  <ui:param name="placeholder" value="Saisir une profession..." />
                  <ui:param name="update" value=":formResultats:dtResultats @(.search-summary)" />
                </ui:include>
    -->
    
    <div class="field">
        <p:outputLabel for="#{id}" value="#{label}" />
        <p:autoComplete id="#{id}" 
                       value="#{value}"
                       completeMethod="#{completeMethod}"
                       placeholder="#{placeholder}"
                       styleClass="w-full">
            <p:ajax event="itemSelect" 
                   update="#{not empty update ? update : ':formResultats:dtResultats @(.search-summary)'}" />
        </p:autoComplete>
    </div>
</ui:composition>

