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

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.

Activity

Show:

Cynthia WilburnMarch 12, 2012 at 1:59 PM

Reopening to add 6.1.1 CE GA2. Close as Fixed.

Michael SaechangJanuary 26, 2012 at 4:43 PM

Committed on:
6.1.x GIT ID: 1e577eb36716e515c95f9590c7b4b97bcda502a3.
6.2.x GIT ID: 0e50bbae47d860ee3ce2b151ee1a0ecfda340be5.

Fixed

Details

Assignee

Reporter

Branch Version/s

6.1.x

Backported to Branch

Committed

Components

Affects versions

Priority

Zendesk Support

Created January 19, 2012 at 9:07 AM
Updated June 24, 2023 at 3:56 PM
Resolved March 12, 2012 at 2:35 PM
Loading...