Expand my Community achievements bar.

SOLVED

Dynamically Insert Row at End w/ Static rows above

Avatar

Level 1

Using LiveCycle Designer 8.2

I need to have a table with a header row, 2 static rows, and then be able to insert rows at the end (after the static rows) .

I have this in my Add Button but nothing happens.  Not sure how to dynamically add the row to the end after the 2 static rows.

tblOtherStudyMS._Row1.addInstance(1);
xfa.form.recalculate(1);

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Check the attache sample..

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

You need to check the Checkbox, Repeat Row for Each Data Item on the last that you want to repeat multiple times. and then use the instance manager to add rows/ remove rows.

In my screen shot below I am setting the checkbox for Row3 in the Table1.

So my Add button click event code will look like:

     Table1.Row3.instanceManager.addInstance(1);

My Remove button click event code will look like:

     if(Table1.Row3.instanceManager.count >1)
          Table1.Row3.instanceManager.removeInstance(1);

Repeat Row.jpg

Thanks

Srini

View solution in original post

5 Replies

Avatar

Correct answer by
Level 10

Check the attache sample..

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

You need to check the Checkbox, Repeat Row for Each Data Item on the last that you want to repeat multiple times. and then use the instance manager to add rows/ remove rows.

In my screen shot below I am setting the checkbox for Row3 in the Table1.

So my Add button click event code will look like:

     Table1.Row3.instanceManager.addInstance(1);

My Remove button click event code will look like:

     if(Table1.Row3.instanceManager.count >1)
          Table1.Row3.instanceManager.removeInstance(1);

Repeat Row.jpg

Thanks

Srini

Avatar

Level 1

Thanks, that helped me go in the right path. I had a couple things wrong.

I didn't have the Repeat Rows checked, the subform flowed, and I was referring to _Row1.  I had all of them named that so instead I left the static one named Row1 and changed the repeating one to Row2.

Avatar

Level 10

You can also use a underscore notation which is a short form for instanceManager..

Both the following are correct..

Table1._Row3.addInstance(1);

Table1.Row3.instanceManager.addInstance(1);

Thanks

Srini

Avatar

Level 1

I did end up using short form.  I didn't know what that meant until now though so thanks for that info.  I'm a newbie!

Avatar

Level 1

I just posted about now sorting in that table I created if you want another challenge.

Thanks.