Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-25001

Validator tag doesn't work when form body is included using <liferay-util:include>

    Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed

      Description

      Validator tag assumes that the aui:form:validatorTagsMap is set as a request attribute.

      Map<String, List<ValidatorTag>> validatorTagsMap =
      (Map<String, List<ValidatorTag>>)request.getAttribute(
      "aui:form:validatorTagsMap");

      Although when the page is included with <liferay-util:include> it's another request, therefore validatorTagsMap is not accessible.

      It's possible to reproduce on Document Library upload_multiple_file_entries.jsp:

      <aui:form action="<%= editMultipleFileEntriesURL %>" method="post" name="fm2" onSubmit='<%= "event.preventDefault(); " + renderResponse.getNamespace() + "updateMultipleFiles();" %>'>
      ...
      <div class="common-file-metadata-container aui-helper-hidden selected" id="<portlet:namespace />commonFileMetadataContainer">
      <liferay-util:include page="/html/portlet/document_library/upload_multiple_file_entries_resources.jsp" />
      </div>
      </aui:form>

      Note that it includes upload_multiple_file_entries_resources.jsp that invokes:

      <%= DDMXSDUtil.getHTML(pageContext, ddmStructure.getXsd(), fields, String.valueOf(ddmStructure.getPrimaryKey()), locale) %>

      When the DDMStructure has a required field it invokes the ValidatorTag causing the form to not render properly.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              julio.camarero Julio Camarero (Inactive)
              Reporter:
              eduardo.lundgren Eduardo Lundgren (Inactive)
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                9 years, 20 weeks, 4 days ago

                  Packages

                  Version Package
                  6.1.1 CE GA2
                  6.1.20 EE GA2
                  6.2.0 CE M2