Rama, in all cases the forms are still pre-populated the same way. Just the XML will change depending on which model you choose (xfa, schema, no model). Ideally you'll use a schema because if you move fields around in the adaptive form, you'll have the same issue that you had with Designer where the xml output will change based on the field location.
That said, one of the easiest ways to experiment with prepopulating is to create your form, then submit your form to your custom service and look at the structure of the XML submitted. Then, re-create that structure and populate the data node in your pre-fill.
In your post.POST.jsp, use String formXML = request.getParameter("jcr:data"); to get the string value of the data submitted.
In your profill.jsp, use the reverse, slingRequest.setAttribute("data", formdata); to populate the data of the form.
Thanks for reverting.
The URL https://helpx.adobe.com/aem-forms/6/prepopulate-adaptive-form-fields.html talks about things involved in bits and pieces, but there no thread that ties all these together.
Could you please send me step by step procedure for achieving a form prefill with just two fields?
Sorry for delay response to this,
Please have a look at the answer provided by internal team:-
- For the first zip file:
- Download and unzip the zip file, Prefill-Sumbit-XMLsAndContentPackage.zip. The zip file contains a package,PrefillandSubmit.zip and xml files containing sample content.
- Import the PrefillandSubmit.zip package to AEM author instance using package share. The following forms are imported to AEM
- Adaptive form with no form model
- Adaptive form with XML Schema
- Adaptive form with XFA
- A repeatable sub form
- Navigate to AEM Forms manager, select a form and preview using the data provided in sample files. For example, to preview the adaptive form with no data model, the URL would be
http://localhost:4502/editor.html/content/forms/af/sampleAFWithNoFormModel.html?wcmmode=di sabled&dataRef=file:///[local path of data file]/AFWithNoDataModel.xml
- For the second zip:
There seems to be an issue with the social connector package. The team is unable to login to Facebook using out of the box cloud connector. Team will update you about the second package in a day or two.
I hope this would be of some help to you.
Thanks and Regards
Sorry for the delay in responding.
I have been away from system for a while and today only I got a chance to test it.
It works fine.
Appreciate your help.