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

Repeating field value in added instances

Avatar

Level 2

Hello,

 

Here's link to my form: https://we.tl/t-HX3piyQgMX

 

I want to create the form where the value from REFERENCE3 field repeats in SECTION 3 - REFERENCE 3 field. The thing is that when the plus button is pressed the new REFERENCE 3 section comes in as well as SECTION 3 section, so that each reference is connected with each table. (I hope that makes sense). 

I had similar problem recently that was solved (https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager-forms/autopopulate-repeat-... - link)  and I tried to use the same code, just modifying it, but I don't know what I do wrong, because it's not working.

 

Thanks,

Magda

 

1 Accepted Solution

Avatar

Correct answer by
Level 5

The issue I found was that the Data Binding for REFERENCE 3 in Section3 was set to "use global Data". By setting it to "Use name" and with the following script in the Exit event of REFERENCE3 field in Section 1, it seemed to be working

var nIndex = this.parent.index;
var sTarget = "form1.Page1.SECTION3["+ nIndex +"].section3FillIn.sectionWrap.ref3";
this.resolveNode(sTarget).rawValue = this.rawValue;

View solution in original post

4 Replies

Avatar

Employee Advisor

@magda93 What's the use case? To get value from top to newly added section?

Avatar

Correct answer by
Level 5

The issue I found was that the Data Binding for REFERENCE 3 in Section3 was set to "use global Data". By setting it to "Use name" and with the following script in the Exit event of REFERENCE3 field in Section 1, it seemed to be working

var nIndex = this.parent.index;
var sTarget = "form1.Page1.SECTION3["+ nIndex +"].section3FillIn.sectionWrap.ref3";
this.resolveNode(sTarget).rawValue = this.rawValue;

Avatar

Level 2

Thank you so much. This code is brilliant and it will help me with my other forms.

 

Thanks,

Magda