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

Multiple Dynamic Tables on the same Form

Avatar

Level 1

Still getting used to working with Adobe LiveCycle.  I am building a form that I want multiple dynamic tables included.  I added the first one and got it working thanks to some postings on this site.  I then went to create another the same way and this one doesn't want to add new rows like the previous one.  I copied and pasted the code in the "Add buttons" and made sure the same properties were set for each table and sub for, but no luck.  here's a look at the structure:

1342412_pastedImage_0.png

The code on the buttons:

var rowNum = this.parent.index + 1;

this.parent.parent.instanceManager.insertInstance(rowNum);

Any ideas, or need more information?

1 Accepted Solution

Avatar

Correct answer by
Level 10

The rowNum is always 0 because the parent of cmdAddVul your referencing is the subform subAddVul not Row1.

Change you script into …

var rowNum = this.parent.parent.index + 1;

this.parent.parent.instanceManager.insertInstance(rowNum);

… or write just …

_Row1.addinstance(true);

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

The rowNum is always 0 because the parent of cmdAddVul your referencing is the subform subAddVul not Row1.

Change you script into …

var rowNum = this.parent.parent.index + 1;

this.parent.parent.instanceManager.insertInstance(rowNum);

… or write just …

_Row1.addinstance(true);

Avatar

Level 1

Simplify...I like it.  Thank you