Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

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

Greg_Fullard
Level 2
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

Adaptive Forms xml
1 Accepted Solution
Mayank_Gandhi
Correct answer by
Community Advisor
Community 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
Mayank_Gandhi
Correct answer by
Community Advisor
Community 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

Greg_Fullard
Level 2
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.
Mayank_Gandhi
Community Advisor
Community 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
Greg_Fullard
Level 2
Level 2
Tx for the help Mayank. It seems I was just selecting the wrong root element on the Fragment. Really appreciate