Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%--
- /**
- * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
- *
- * The contents of this file are subject to the terms of the applicable
- * Liferay software end user license agreement ("License Agreement")
- * found on www.liferay.com/legal/eulas. You may also contact Liferay, Inc.
- * for a copy of the License Agreement. You may not use this file except in
- * compliance with the License Agreement.
- * See the License Agreement for the specific language governing
- * permissions and limitations under the License Agreement, including
- * but not limited to distribution rights of the Software.
- *
- */
- --%>
- <%@ include file="/html/init.jsp" %>
- <%
- %>
- <liferay-portlet:actionURL portletConfiguration="true" var="configurationActionURL" />
- <liferay-portlet:renderURL portletConfiguration="true" var="configurationRenderURL" />
- <aui:form action="<%= configurationActionURL %>" method="post" name="fm">
- <aui:input name="<%= Constants.CMD %>" type="hidden" value="<%= Constants.UPDATE %>" />
- <aui:input name="redirect" type="hidden" value="<%= configurationRenderURL %>" />
- <div class="rows-container downloadFields" id="downloadFields">
- <%
- String formFieldsIndexesParam = ParamUtil.getString(renderRequest, "formFieldsIndexes") ;
- int[] formFieldsIndexes = null;
- if (Validator.isNotNull(formFieldsIndexesParam)) {
- formFieldsIndexes = StringUtil.split(formFieldsIndexesParam, 0);
- }
- else {
- formFieldsIndexes = new int[0];
- for (int i = 1; true; i++) {
- String standardNumber = PrefsParamUtil.getString(portletPreferences, request, "standardNumber" + i);
- String copyrightHolder = PrefsParamUtil.getString(portletPreferences, request, "copyrightHolder" + i);
- if (Validator.isNull(standardNumber) && Validator.isNull(copyrightHolder)) {
- break;
- }
- formFieldsIndexes = ArrayUtil.append(formFieldsIndexes, i);
- }
- if (formFieldsIndexes.length == 0) {
- formFieldsIndexes = ArrayUtil.append(formFieldsIndexes, -1);
- }
- }
- int index = 1;
- System.out.println(formFieldsIndexes);
- for (int formFieldsIndex : formFieldsIndexes) {
- request.setAttribute("configuration.jsp-index", String.valueOf(index));
- request.setAttribute("configuration.jsp-formFieldsIndex", String.valueOf(formFieldsIndex));
- %>
- <div class="lfr-form-row lfr-form-row-inline" id="<portlet:namespace />fieldset<%= formFieldsIndex %>">
- <div class="row-fields">
- <aui:input fieldParam='<%= "standardNumber" + formFieldsIndex %>' id='<%= "standardNumber" + formFieldsIndex %>' name="standardNumber"></aui:input>
- <aui:input fieldParam='<%= "copyrightHolder" + formFieldsIndex %>' id='<%= "copyrightHolder" + formFieldsIndex %>' name="copyrightHolder"></aui:input>
- </div>
- </div>
- <%
- }
- %>
- <aui:input name="formFieldsIndexes" type="hidden" value="<%= StringUtil.merge(formFieldsIndexes) %>" />
- </div>
- <aui:script use="liferay-auto-fields">
- var downloadFields = A.one('#downloadFields');
- var autoFields = new Liferay.AutoFields(
- {
- contentBox: '#downloadFields',
- fieldIndexes: '<portlet:namespace />formFieldsIndexes',
- namespace: '<portlet:namespace />',
- <liferay-portlet:renderURL portletConfiguration="true" var="editFieldURL" windowState="<%= LiferayWindowState.EXCLUSIVE.toString() %>">
- <portlet:param name="<%= Constants.CMD %>" value="<%= Constants.ADD %>" />
- </liferay-portlet:renderURL>
- url: '<%= editFieldURL %>'
- }
- ).render();
- downloadFields.setData('autoFieldsInstance', autoFields);
- </aui:script>
- <aui:layout>
- <aui:column>
- <aui:button-row>
- <aui:button cssClass="submit" onClick="saveData();" type="submit" />
- </aui:button-row>
- </aui:column>
- </aui:layout>
- </aui:form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement