<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 DataTable réutilisable avec configuration standard - DRY/WOU
        Usage :
        <ui:decorate template="/templates/components/tables/data-table.xhtml">
            <ui:param name="id" value="dtItems"/>
            <ui:param name="value" value="#{bean.items}"/>
            <ui:param name="var" value="item"/>
            <ui:param name="emptyMessage" value="Aucun élément trouvé"/>
            <ui:param name="rows" value="20"/>
            <ui:param name="rowsPerPageTemplate" value="10,20,50,100"/>
            <ui:param name="paginator" value="true"/>
            <ui:param name="lazy" value="false"/>
            <ui:param name="selectionMode" value="single"/>
            <ui:param name="selection" value="#{bean.selectedItem}"/>
            <ui:define name="columns">
                <p:column headerText="Nom">...</p:column>
                <p:column headerText="Actions">...</p:column>
            </ui:define>
        </ui:decorate>
    -->

    <p:dataTable id="#{id}"
                 value="#{value}"
                 var="item"
                 paginator="#{empty paginator ? 'true' : paginator}"
                 rows="#{empty rows ? 20 : rows}"
                 rowsPerPageTemplate="#{empty rowsPerPageTemplate ? '10,20,50,100' : rowsPerPageTemplate}"
                 paginatorPosition="#{empty paginatorPosition ? 'bottom' : paginatorPosition}"
                 emptyMessage="#{empty emptyMessage ? 'Aucun élément trouvé' : emptyMessage}"
                 styleClass="table-responsive #{styleClass}"
                 lazy="#{not empty lazy and lazy}"
                 selectionMode="#{selectionMode}"
                 selection="#{selection}"
                 rowKey="#{rowKey}"
                 sortMode="#{sortMode}"
                 sortField="#{sortField}"
                 sortOrder="#{sortOrder}"
                 filteredValue="#{filteredValue}"
                 widgetVar="#{widgetVar}"
                 size="#{size}">
        
        <ui:insert name="columns">
            <!-- Table columns go here -->
        </ui:insert>
    </p:dataTable>
</ui:composition>

