Monday, 25 May 2015

Liferay Auto-Text-Field Example

<%@page import="javax.portlet.ActionRequest"%>
<%@page import="javax.portlet.PortletURL"%>
<%@page import="java.util.ArrayList"%>
<%@ taglib uri="" prefix="portlet" %>
<%@ taglib uri="" prefix = "aui"%>

 PortletURL portalURL = renderResponse.createActionURL();
 portalURL.setParameter(ActionRequest.ACTION_NAME, " getAutoFieldsData");

<aui:form name="fm" method="POST" action="<%=portalURL.toString()%>" >

<div id="phone-fields">
    <div class="lfr-form-row lfr-form-row-inline">
      <div class="row-fields" style="display:flex;">
        <aui:input type="text" label="" name="phonesIndexes" id="phonesIndexes" helpMessage="Enter News Event Info " value="" >
<aui:validator name="required"/>


AUI().use('liferay-auto-fields',function(A) {
 new Liferay.AutoFields(
           contentBox: '#phone-fields',
           fieldIndexes: '<portlet:namespace />phonesIndexes'

#Action Phase :
 public void getAutoFieldsData(ActionRequest actionRequest,ActionResponse response)
                                    throws Exception {
String phonesIndexesString = actionRequest.getParameter("phonesIndexes");
int[] phonesIndexes = StringUtil.split(phonesIndexesString, 0);
for (int phonesIndex : phonesIndexes) {
String number = ParamUtil.getString(actionRequest, "phoneNumber" + phonesIndex);
int typeId = ParamUtil.getInteger(actionRequest, "phoneTypeId" + phonesIndex);


  1. Very informative post.This is immense in turn precise here. Thank you for posting them. Great piece of writing given that much approaching into the part.These types of articles are really ready to lend a hand for the mankind and one who are mysterious with these. Professional resume writing service is the biggest system of ensured professional resume authors. Amid the procedure, you will work one-on-one with a guaranteed, experienced professional until you have a resume you are fulfilled by.

  2. how can we get the liferay auto field value in javascript?

    My requirement is that I have resource request to save my data. so how can I get all the dynamic parameter value in javascript?