Validator tag doesn't work when form body is included using <liferay-util:include>
Description
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
Liferay WCMLiferay WCM(Deactivated)Reporter
eduardo.lundgren@liferay.comeduardo.lundgren@liferay.com(Deactivated)Branch Version/s
6.1.xBackported to Branch
CommittedComponents
Fix versions
Affects versions
Priority
Medium
Details
Details
Assignee

Reporter

Branch Version/s
6.1.x
Backported to Branch
Committed
Components
Fix versions
Affects versions
Priority
Zendesk Support
Linked Tickets
Zendesk Support
Linked Tickets
Zendesk Support

Linked Tickets
Created January 19, 2012 at 9:07 AM
Updated June 24, 2023 at 3:56 PM
Resolved March 12, 2012 at 2:35 PM
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.