When would you use the slingRequest.setAttribute("data", data XML) line of code?
When would you use the slingRequest.setAttribute("data", data XML) line of code?
The slingRequest.setAttribute("data", data XML) line of code is used to pre-populate form data. This line of code sets an attribute on the Sling request object, which is then typically used by the form to pre-fill its fields with the XML data provided. This is a common practice in adaptive forms or other dynamic user interfaces to enhance user experience by presenting pre-filled forms based on user data or previous interactions.
sorry I mean A is correct..
ans is A https://docs.adobe.com/content/help/en/experience-manager-learn/forms/adaptive-forms/prepopulating-html5-forms-in-aem-forms-article.html
Once you create your custom profile, you will then create a JSP file which will fetch the data by making calls to your backend system. Once the data is fetched you will use the slingRequest.setAttribute("data", content); to pre-populate the form https://docs.adobe.com/content/help/en/experience-manager-learn/forms/adaptive-forms/prepopulating-html5-forms-in-aem-forms-article.html B is correct
https://helpx.adobe.com/aem-forms/6/prepopulate-adaptive-form-fields.html