我开始使用 liferay-auto-fields 合成器。
所以这是我的带有 aui:script 的 jsp -->
<aui:form action="<%=saveMotiveURL%>" name="fm" method="post" enctype="multipart/form-data" onSubmit="setZones()" >
<aui:fieldset>
<aui:field-wrapper>
<div id="emailAdress-fields">
<label class="control-label"><liferay-ui:message key="motiveConfigEdit.col5"></liferay-ui:message> </label>
<div class="lfr-form-row lfr-form-row-inline">
<div class="row-fields">
<aui:input type="text" name="emailAdress1" fieldParam='emailAdress1' id='emailAdress1' label="" value=""/>
<aui:input type="hidden" name="motiveEmailId1" fieldParam='motiveEmailId1' id='motiveEmailId1' value=""/>
</div>
</div>
</div>
<aui:button type="submit" name="saveButton" value="button.create" label=""/>
</aui:field-wrapper>
</aui:fieldset>
</aui:form>
<aui:script>
AUI().use('liferay-auto-fields',function(A) {
new Liferay.AutoFields(
{
contentBox: '#emailAdress-fields',
fieldIndexes: '<portlet:namespace />rowIndexes'
}
).render();
});
</aui:script>
然后,我想在 processaction 函数中检索“rowIndexes”,所以我这样做:
String rowIndexes = actionRequest.getParameter("rowIndexes");
这总是给我空。我还注意到,当我通过单击“+”按钮获得自动字段时,jsp 'rowIndexes' 中的隐藏字段不会更改或具有值。
有人有解决方案吗?
谢谢