Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Injecting externally managed content into AEM HTML5 (XDP) Form

Avatar

Level 1

We are using the AEM Forms HTML5 capability to put a large number of XDP based forms online. Some of the forms contain common bits of text content (like an official brand name, contact email address or phone number) which we want to centrally manage so changes can be updated for all forms in one go. 

 

I had a look around, and saw that data from external sources can be passed into the form using data or dataRef parameters, but this seems very much focussed on binding the data to fields, rather than plain content. Whats the best way to bind external data to content in the form?

 

I have seen this done in pure XDP forms using span elements with xfa:embed 'binding' to floating fields, but this doesn't seem to work in HTML5 forms (perhaps its not supported).

 

 

3 Replies

Avatar

Employee

For HTML Forms, you can inject the data using data and dataRef attributes only, as explained here.

 

Avatar

Level 1

Thanks @Mayank_Tiwari - I understand this is the way to get the content into the form data model, but how can I render this content? Am I limited to binding it to a specific field element, or are there other ways to render this? Can I for example bind it to a hidden or floating field, and then refer to this field value within a block of content (similar to the xfa:embed approach mentioned in my question)

Avatar

Employee

I would suggest you to use Adaptive Forms(instead of HTML5 forms) using the same XDP template, , as adaptive forms offers Form data model, using which you can easily achieve this use case.