How to get the form data

Avatar

Avatar

Jing_Luo

Avatar

Jing_Luo

Jing_Luo

15-10-2015

I am working on an adaptive form. I upload a Test.xdp file. Then use the template as areference to synchronize with the adaptive form.

I have three step in the form.

[img]qq.png[/img]

  1. Step 1, adaptive form. I drag the form elements into the  Adaptive Form Page.
  2. Step 2, verifyfilldata.
  3. Step 3, send an email to a process. The email include an Test.xml attachment.  There is a button to submit the form .

I have created a custom submit action for my form .

Now my problem is how to get the form data in the post.POST.jsp .

There are 2 problems I need to fix.

  1. I tried use String First = request.getParameter("First"); to get thie First name field value, it doesn't work,because the submit button in the Step 3 panel,I made the button in the Step 1, it works.
  2. But I only can get the data who is not have the Bind reference.

Can someone help me

Thanks advance

Jing

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

15-10-2015

Another way to get data posted from an Adaptive form is to post data to an OSGi service. Then you can use Java logic to process the data to meet your business requirements. See this article: 

Posting AEM 6 Form Data to Custom Services

Answers (1)

Answers (1)

Avatar

Avatar

Jing_Luo

Avatar

Jing_Luo

Jing_Luo

15-10-2015

Hi, I have got the solution for this question.

Document dataXml = null;
    if(slingRequest.getParameter("jcr:data")!=null) {
        dataXml = new Document(slingRequest.getRequestParameter("jcr:data").get());
     }

The "dataXml " is the data of the form.