<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * Subscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */
--%>

<%@ include file="/init.jsp" %>

<%
SelectStructureFieldDisplayContext selectStructureFieldDisplayContext = new SelectStructureFieldDisplayContext(request, liferayPortletResponse);
%>

<div class="alert alert-danger hide" id="<portlet:namespace />message">
	<span class="error-message"><liferay-ui:message key="the-field-value-is-invalid" /></span>
</div>

<clay:container-fluid
	id='<%= liferayPortletResponse.getNamespace() + "selectDDMStructureFieldForm" %>'
>
	<clay:select
		containerCssClass="mt-3"
		id='<%= liferayPortletResponse.getNamespace() + "fieldName" %>'
		label="select"
		name="fieldName"
		options="<%= selectStructureFieldDisplayContext.getSelectOptions() %>"
	/>

	<aui:form action="<%= selectStructureFieldDisplayContext.getFieldValueURL() %>" name="fieldForm" onSubmit="event.preventDefault()">
		<aui:input name="name" type="hidden" />

		<div id="<portlet:namespace />selectDDMStructureFieldContainer"></div>

		<clay:button
			displayType="primary"
			id='<%= liferayPortletResponse.getNamespace() + "applyButton" %>'
			label="apply"
			type="button"
		/>
	</aui:form>
</clay:container-fluid>

<liferay-frontend:component
	componentId='<%= liferayPortletResponse.getNamespace() + "selectStructureField" %>'
	context="<%= selectStructureFieldDisplayContext.getComponentContextData() %>"
	module="js/SelectStructureField"
/>