<?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:f="http://xmlns.jcp.org/jsf/core" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:h="http://xmlns.jcp.org/jsf/html"
  xmlns:p="http://primefaces.org/ui" xmlns:e="http://www.ivu.de/elect/tags">

  <ui:param name="rendered" value="#{rendered ne false}" />
  <ui:param name="disabled" value="#{disabled eq true}" />
  <ui:param name="readonly" value="#{readonly eq true}" />
  <ui:param name="focused" value="#{focused eq true}" />

  <ui:param name="required" value="#{required eq true}" />
  <ui:param name="maxlength" value="#{empty maxlength ? 255 : maxlength}" />

  <!-- ELECTMUC-2753 von-bis-Datumsfelder nebeneinander -->
  <ui:param name="hasSecondInput" value="#{not empty id2}" />

  <ui:param name="for" value="#{componentHelper.getClientFocusId(id)}" />
  <ui:insert name="before" />

  <p:outputPanel styleClass="ui-editpanel #{not empty hints or (not empty facesContext and not empty facesContext.getMessageList(componentHelper.getClientId(id))) ? 'ui-state-message-present' : ''} #{propertyContainerStyleClass}">
    <c:if test="#{layoutComponents.editHintsOnTop}">
      <ui:include src="/WEB-INF/templates/edit-hints.xhtml" />
    </c:if>

    <p:message for="#{id}" />

    <c:if test="#{hasSecondInput}">
      <p:message for="#{id2}" />
    </c:if>

    <p:focus for="#{id}" rendered="#{focused}" />

    <div class="ui-editpanel-content">
      <ui:insert name="outputLabel">
        <e:outputLabel for="#{for}" disabled="#{disabled or readonly}" value="#{label}" />
      </ui:insert>

      <ui:insert name="inputComponent" />

      <c:if test="#{not layoutComponents.editHintsOnTop}">
        <ui:include src="/WEB-INF/templates/edit-hints.xhtml" />
      </c:if>
    </div>

    <e:outputTooltip rendered="#{not disabled and not readonly}" for="#{id}" value="#{tooltip}" />

    <c:if test="#{hasSecondInput}">
      <e:outputTooltip rendered="#{not disabled and not readonly}" for="#{id2}" value="#{tooltip}" />
    </c:if>
  </p:outputPanel>
</ui:composition>
