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

Binding repeatable fields

Avatar

Level 3

Hi all,

I need to be able to bind multiple sets of text-fields together so that each set always has the same value. The idea is that I have a table where a user enters values such as a product name, and then on another page, where they enter information about the product, there is a header with the product name that is bound to the first text-field so the user does not have to enter information twice. The problem is that both instances of the text-field are repeatable. I have them each set in a table row that is repeatable, so the user can add as many instances as they want.

Are there any solutions to this?

1 Accepted Solution

Avatar

Correct answer by
Level 3

I figured out a way to do this. In the exit event of each text-field, you can use the following:

for (i=0; i<Table1._Row1.count; i++) {

    if (this.parent.index === i) {

        this.resolveNode("Table2.Row1[" + i.toString() + "].Cell1").rawValue = this.resolveNode("$").rawValue;

    }

}

just switch out Table2 for Table1 in the second table or repeatable subform

View solution in original post

1 Reply

Avatar

Correct answer by
Level 3

I figured out a way to do this. In the exit event of each text-field, you can use the following:

for (i=0; i<Table1._Row1.count; i++) {

    if (this.parent.index === i) {

        this.resolveNode("Table2.Row1[" + i.toString() + "].Cell1").rawValue = this.resolveNode("$").rawValue;

    }

}

just switch out Table2 for Table1 in the second table or repeatable subform