Expand my Community achievements bar.

SOLVED

How to get the form data

Avatar

Former Community Member

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

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

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

Avatar

Former Community Member

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.