Use the following code in your jsp page
<div id="link-fields">
<div class="lfr-form-row lfr-form-row-inline">
<div class="row-fields">
<aui:input fieldParam='linkNumber0' id='linkNumber0' name="linkNumber0" label="Links" />
</div>
</div>
</div>
<aui:script use="liferay-auto-fields">
new Liferay.AutoFields(
{
contentBox: '#link-fields',
fieldIndexes: '<portlet:namespace />linksIndexes'
}
).render();
</aui:script>
Use this in your action method
String linksIndexesString = actionRequest.getParameter(
"linksIndexes");
System.out.println("=============linksIndexesString=="+linksIndexesString);
int[] linksIndexes = StringUtil.split(linksIndexesString, 0);
for (int linksIndex : linksIndexes) {
String number = ParamUtil.getString(actionRequest, "linkNumber" + linksIndex);
System.out.println("=============linkNumber=="+number);
}
<div id="link-fields">
<div class="lfr-form-row lfr-form-row-inline">
<div class="row-fields">
<aui:input fieldParam='linkNumber0' id='linkNumber0' name="linkNumber0" label="Links" />
</div>
</div>
</div>
<aui:script use="liferay-auto-fields">
new Liferay.AutoFields(
{
contentBox: '#link-fields',
fieldIndexes: '<portlet:namespace />linksIndexes'
}
).render();
</aui:script>
Use this in your action method
String linksIndexesString = actionRequest.getParameter(
"linksIndexes");
System.out.println("=============linksIndexesString=="+linksIndexesString);
int[] linksIndexes = StringUtil.split(linksIndexesString, 0);
for (int linksIndex : linksIndexes) {
String number = ParamUtil.getString(actionRequest, "linkNumber" + linksIndex);
System.out.println("=============linkNumber=="+number);
}
0 comments:
Post a Comment