<?xml version="1.0" encoding="UTF-8"?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:p="http://primefaces.org/ui"
    xmlns:e="http://www.ivu.de/elect/tags">

    <ui:decorate template="/WEB-INF/templates/personenregister/entity-personenregister-personendaten-selection.xhtml">
        <ui:define name="customSearchFooterButtonsSucceeding"> <!-- ELECTMUC-2503 -->
            <p:commandButton rendered="#{selectionView.btnSearchWahlvorschlagsPersonPoolRendered}" disabled="#{selectionView.btnSearchWahlvorschlagsPersonPoolDisabled}" action="#{selectionView.searchWahlvorschlagsPersonPool}" ajax="false"
                onclick="PF('ctnContentBlockUI').show();" value="#{interpolator.interpolate('entity.mit.personendaten.selection.action.search', 'Datenbank')}" />
        </ui:define>

        <ui:define name="customSearchResults">
            <h:form rendered="#{not empty selectionView.wahlvorschlagsPersonPoolSearchResult}">
                <p:dataTable id="tblWahlvorschlagsPersonPoolSearchResult" value="#{selectionView.wahlvorschlagsPersonPoolSearchResult}" var="wahlvorschlagsPersonPoolSearchResultEntry"
                    rowKey="#{wahlvorschlagsPersonPoolSearchResultEntry.uuid}" rowIndexVar="rowIndexZeroBased" selectionMode="single" selection="#{selectionView.wahlvorschlagsPersonPoolSearchResultSelection}"
                    emptyMessage="#{msgs['component.data.table.empty.message']}" widgetVar="tblWahlvorschlagsPersonPoolSearchResultWidget">
                    <c:if test="#{not empty wahlvorschlagsPersonPoolSearchResultEntryActionMenu and wahlvorschlagsPersonPoolSearchResultEntryActionMenu.rendered}">
                        <p:ajax event="rowDblselect" listener="#{wahlvorschlagsPersonPoolSearchResultEntryActionMenu.onRowDblselect}" />
                    </c:if>

                    <e:dataTableActionMenuColumns rowEntity="#{wahlvorschlagsPersonPoolSearchResultEntry}" rowSelection="#{selectionView.wahlvorschlagsPersonPoolSearchResultSelection}"
                        columnBuilder="#{wahlvorschlagsPersonPoolSearchResultEntryColumnBuilder}" disableSort="#{false}" actionMenu="#{wahlvorschlagsPersonPoolSearchResultEntryActionMenu}"
                        onActionMenuClick="PF('tblWahlvorschlagsPersonPoolSearchResultWidget').selectActionMenuRow(#{rowIndexZeroBased}); return false;" />
                </p:dataTable>
            </h:form>
        </ui:define>
    </ui:decorate>
</ui:composition>
