Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Table Row duplicates on button click but carries the data with it

Avatar

Former Community Member

What I mean is, I have a form with a table on page one. I have created floating fields on page two where the data typed into the table flows into text fields, which is working just fine. I have added a button for the user to add rows to the table and made the table row repeat.

However, when I type data into the table and click the button to add another row, it duplicates the row with the data that I typed in. Obviously, this is not what I mean to have happen. I have never had this problem before. Is it because of the floating fields. What am I doing wrong?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

You could use two tables (one on the input page and one on the letter page) that are linked. See here for an example: http://assure.ly/eTOXaH.

Note that the script in in the exit event of the fields in the table.

Hope that helps,

Niall

View solution in original post

4 Replies

Avatar

Level 10

Hi,

Yes, it is because of the floating fields. The issue is that the floating fields work on the basis of a hidden field with the binding set to Global. When you have a field in a repeating row, then the field will also have the same value in ALL repeating instances, becuase the binding is set to Global.

All fields with the same name in the form (no matter where they are located) will have the same value if the binding is set to Global.

Hope that helps,

Niall

Avatar

Former Community Member

So are you saying that there is no way to do what I'm trying to do? Or maybe that there's a better way?

The client has outstanding bills. I don't know how many. So that's why I used a table with a repeating row.

It needs to output to the client letter saying:

You owe     (ffName)         (ffAmount)

And be able to add additional bills if necessary.  How can I do this?

Avatar

Correct answer by
Level 10

Hi,

You could use two tables (one on the input page and one on the letter page) that are linked. See here for an example: http://assure.ly/eTOXaH.

Note that the script in in the exit event of the fields in the table.

Hope that helps,

Niall

Avatar

Former Community Member

I'm stealing your tables! Excellent. Thank you.