<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"
                xmlns:o="http://omnifaces.org/ui">

    <!--
        Composant bouton info réutilisable (WOU/DRY)
        action="#{bean.method}" supporté via o:methodParam (void ou retour String)
    -->

    <o:methodParam name="actionMethod" value="#{action}" />

    <ui:fragment rendered="#{empty rendered or rendered}">
        <ui:fragment rendered="#{empty outcome}">
            <ui:fragment rendered="#{not empty update and update != 'none'}">
                <p:commandButton
                    value="#{value}"
                    icon="#{icon}"
                    action="#{actionMethod}"
                    update="#{update}"
                    onclick="#{onclick}"
                    oncomplete="#{oncomplete}"
                    disabled="#{not empty disabled and disabled}"
                    rendered="#{empty rendered or rendered}"
                    styleClass="ui-button-info #{not empty outlined and outlined ? 'ui-button-outlined' : ''} #{not empty styleClass ? styleClass : ''}"
                    title="#{title}" />
            </ui:fragment>
            <ui:fragment rendered="#{empty update or update == 'none'}">
                <p:commandButton
                    value="#{value}"
                    icon="#{icon}"
                    action="#{actionMethod}"
                    ajax="false"
                    onclick="#{onclick}"
                    oncomplete="#{oncomplete}"
                    disabled="#{not empty disabled and disabled}"
                    rendered="#{empty rendered or rendered}"
                    styleClass="ui-button-info #{not empty outlined and outlined ? 'ui-button-outlined' : ''} #{not empty styleClass ? styleClass : ''}"
                    title="#{title}" />
            </ui:fragment>
        </ui:fragment>
        <ui:fragment rendered="#{not empty outcome}">
            <p:button
                value="#{value}"
                icon="#{icon}"
                outcome="#{outcome}"
                styleClass="ui-button-info #{not empty outlined and outlined ? 'ui-button-outlined' : ''} #{styleClass}"
                title="#{title}" />
        </ui:fragment>
    </ui:fragment>
</ui:composition>
