Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Relative XML data binding in AEM Adaptive forms - Is this possible?

Avatar

Level 2

In the good-ol' days of Adobe LiveCycle we often reused form fragments multiple times in a single form. To ensure data bindings worked correctly we would:

  • Bind the fragment subform to a higher-level XML element (i.e. a complex type)
  • Bind fields inside the fragment to individual XML elements 

At runtime, the form would then assemble to XML binding by adding the subform binding and the field binding together.

I can't seem to get this capability working in AEM Adaptive forms. Not sure if I'm doing something wrong, but it seems that you have to add an absolute binding on the field. 

Am I missing something?

 

Here's what I'm looking for in AEM Adaptive Forms:

Let's say I have the following XML

<MyForm>
<PostalAddress>
<Line1>PO Line1<Line1>
<Line2>PO Line1<Line2>
<Line3>PO Line1<Line3>
</PostalAddress>
<PhysicalAddress>
<Line1>Physical Line 1<Line1>
<Line2>Physical Line 1<Line2>
<Line3>Physical Line 1<Line3>
</PhysicalAddress>
</MyForm>

 

I want to create a Form Fragment for an Address. Inside the form fragment, I will have three fields, each with relative bindings, i.e. /Line1, /Line2 and /Line3

 

In my main Adaptive form I will then have two panels, both linked to the single Address Fragment, but they will have different bindings. One will be bound to /MyForm/PhysicalAddress and the other to /MyForm/PostalAddress.

 

But if I do this in AEM Adaptive forms (6.3), the data doesn't pull through when I do a preview with Data.

 

Hope my description makes sense

 

Thanks for the assistance

 

Greg

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Can you please share both the sample form with relative and absolute binding with test data XML. I will test on ES4 and AEM Designer to confirm the results. Upload the form in some drive and share the link.

@Greg_Fullard 

View solution in original post

4 Replies

Avatar

Correct answer by
Employee Advisor

Can you please share both the sample form with relative and absolute binding with test data XML. I will test on ES4 and AEM Designer to confirm the results. Upload the form in some drive and share the link.

@Greg_Fullard 

Avatar

Level 2
Hi Mayank. Problem is on an Adaptive form, I was just referencing LiveCycle to explain the functionality I'm looking for. I'll add some more detail in the question.

Avatar

Employee Advisor
@Greg_Fullard Make sure the XSD being used in main form and fragment has the root element selected correctly so that the fragment identifies itself as child of main form

Avatar

Level 2
Tx for the help Mayank. It seems I was just selecting the wrong root element on the Fragment. Really appreciate