<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0">
  <jsp:output omit-xml-declaration="yes" />

  <jsp:directive.attribute name="id" type="java.lang.String" required="true" description="The identifier for this tag (do not change!)" />
  <jsp:directive.attribute name="modelAttribute" type="java.lang.String" required="true" description="The name of the model attribute for form binding" />
  <jsp:directive.attribute name="path" type="java.lang.String" required="true" description="Specify the relative URL path (with leading /)" />
  <jsp:directive.attribute name="label" type="java.lang.String" required="false" description="The label used for this object, will default to a message bundle if not supplied" />
  <jsp:directive.attribute name="idField" type="java.lang.String" required="false" description="Specify the field name of the id field (default 'id')" />
  <jsp:directive.attribute name="versionField" type="java.lang.String" required="false" description="Specify the field name of the version field (default 'version'). If specified 'none' the version field will not be inlcuded (versionField='none')." />
  <jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" />
  <jsp:directive.attribute name="openPane" type="java.lang.Boolean" required="false" description="Control if the title pane is opened or closed by default (default: true)" />
  <jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" />

  <c:if test="${empty render or render}">
    <c:if test="${empty label}">
      <spring:message code="label_${fn:toLowerCase(fn:substringAfter(id,'_'))}" var="label" />
    </c:if>
    <c:if test="${empty idField}">
      <c:set value="id" var="idField" />
    </c:if>
    <c:if test="${empty versionField}">
      <c:set value="version" var="versionField" />
    </c:if>
    <spring:message arguments="${label}" code="entity_update" var="title_msg" />
    <util:panel id="${id}" title="${title_msg}" openPane="${openPane}">
      <spring:url value="${path}" var="form_url" />
      <form:form action="${fn:escapeXml(form_url)}" method="PUT" modelAttribute="${modelAttribute}">
        <form:errors cssClass="errors" delimiter="&lt;p/&gt;" />
        <jsp:doBody />
        <div class="submit" id="${fn:escapeXml(id)}_submit">
          <spring:message code="button_save" var="save_button" />
          <script type="text/javascript">Spring.addDecoration(new Spring.ValidateAllDecoration({elementId:'proceed', event:'onclick'}));</script>
          <input id="proceed" type="submit" value="${fn:escapeXml(save_button)}" />
        </div>
        <form:hidden id="_${fn:escapeXml(idField)}_id" path="${fn:escapeXml(idField)}" />
        <c:if test="${versionField ne 'none'}">
          <form:hidden id="_${fn:escapeXml(versionField)}_id" path="${fn:escapeXml(versionField)}" />
        </c:if>
      </form:form>
    </util:panel>
  </c:if>
</jsp:root>