Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Auto populating a Value in a Dynamic Table

Avatar

Level 3

Hello:

Problem:

I have a table with 4 fields...  The table is dynamic so I can press a button and add another row.  What I need is the ability when I press the button to add the new row the first field is automatically populated with the value from the first row field 2.

I tried the following:

table1.section[0].row[1].field1.rawvalue = table1.section[0].row[0].field2.rawvalue;

I get that the table1.section[0].row[1] does not have a property error.

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Here is the updated form..

https://acrobat.com/#d=HBuXBqo64vZ4F5zxTzyZFA

I Unchecked the "Repeat Section for Each Data Item" for Section and left the Row to repeat..

Table1.TableSection.resolveNode("Row1[" + this.parent.index + "]").TextField1.rawValue = Table1.TableSection.Row1.TextField2.rawValue;

In the above code I am passing the index of Row1 to resolve the node, so that it will be referenced properly.

Hope this helps..

Thanks

Srini

View solution in original post

3 Replies

Avatar

Level 10

Hi,

Your script would need to look at the index value of the new instance and then use that to reference the objects in the new row and the row above. Once you have the index, you can resolveNode to reference the objects that you want.

There are examples on the forum, try 'looping through rows' as a forum search.

Alternatively, it would be easier if you could post your form or a part of your form on a file sharing site.

Niall

Avatar

Level 10

The meaning of the error is with the reference to the Field was not proper..

If you can post your form to LiveCycle9@gmail.com, I can check it..

Thanks

Srini

Avatar

Correct answer by
Level 10

Here is the updated form..

https://acrobat.com/#d=HBuXBqo64vZ4F5zxTzyZFA

I Unchecked the "Repeat Section for Each Data Item" for Section and left the Row to repeat..

Table1.TableSection.resolveNode("Row1[" + this.parent.index + "]").TextField1.rawValue = Table1.TableSection.Row1.TextField2.rawValue;

In the above code I am passing the index of Row1 to resolve the node, so that it will be referenced properly.

Hope this helps..

Thanks

Srini