javascriptlivecycle-designer

ES4 Dynamic Tables - not growing the table rows


I am working with ES4 and trying to create a table that will grow with the use of a button. I followed an online tutorial that was about 4 years old, but all the steps were valid with my version of LiveCycle. So I used the table wizard to create a 3 column table with headers. Next I placed a button next to the table. I then used the Action Builder tool to create action which was:

Condition: When button Button1 is clicked

Result: Add a new instance of Row1

This resulted in the following code for the button:

this.resolveNode('Table1._Row1').addInstance(1);

if (xfa.host.version < 8) {

    xfa.form.recalculate(1);

}

When I go to the Preview PDF tab, it has the table and the button, but clicking the button does nothing. The warnings tab at the bottom has no errors listed. Any ideas on why it wouldnt be working? The table and the button are the only items on the form (testing). I've done some javascript to populate text fields in forms, so I know my system will run javascript in LiveCycle.


Solution

  • Turns out I was saving the PDF as an "Adobe Static XML Form" vs "Adobe Dynamic XML Form". Once I switched it over to Dynamic, the table started expanding as expected.