These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Need to add 2 rows to dynamic table

Wuffo
Registered: Jun 28 2011
Posts: 7

Brand new to this, but I have managed to do create a button - when clicked, adds 1 row to table.
 
I want the script to duplicate the first 2 rows, placing them in rows 3 & 4. However, what happens is that using the code below, I only get 1 field added, and that is between my original dropdown and original text field.
 
The code I have used is:

----- form1.#subform[1].Button1::click: - (JavaScript, client) --------------------
 
Table1.Row1.instanceManager.addInstance(1);
 
I cannot figure out how to do do this. I have tried changing the code to "Row2", but nothing happens. I tried using the name of the text field, but again, nothing. I have read most of the post but none seem to address it.
 
Many thanks, in anticipation.

My Product Information:
LiveCycle Designer, Windows
RichManBob
Registered: Mar 3 2009
Posts: 5
A solution I've used is to:

1. Create a table containing one row, and one cell in that row.
2. Drop a subform object onto the row 1 cell; this subform becomes a container for the two rows you want to duplicate.
3. Give the subform a fixed width (the width of your row), and fixed height (the height of two rows).
4. Drop two more subforms in the row 1 "container subform" and set their height/width as needed; they'll become row 1 and row 2 containers.
5. Drop objects (text fields, etc) into row 1 and 2 as needed.
6. Now when you do
Table1.Row1.instanceManager.addinstance(1)
it duplicates your container row (containing rows 1 and 2) to create a row (rows 3 and 4).

This is a solution I've used which has worked.
Wuffo
Registered: Jun 28 2011
Posts: 7
RichManBob wrote:
A solution I've used is to:1. Create a table containing one row, and one cell in that row.
2. Drop a subform object onto the row 1 cell; this subform becomes a container for the two rows you want to duplicate.
3. Give the subform a fixed width (the width of your row), and fixed height (the height of two rows).
4. Drop two more subforms in the row 1 "container subform" and set their height/width as needed; they'll become row 1 and row 2 containers.
5. Drop objects (text fields, etc) into row 1 and 2 as needed.
6. Now when you do
Table1.Row1.instanceManager.addinstance(1)
it duplicates your container row (containing rows 1 and 2) to create a row (rows 3 and 4).

This is a solution I've used which has worked.
RichManBob

Many thanks for replying. Tried your suggestion, but I get this error message:


GeneralError: Operation failed.
XFAObject.addInstance:3:XFA:form1[0]:Table2[0]:Row1[0]:Subform1[0]:Button6[0]:click
The element [max] has violated its allowable number of occurrences.

I have no clue what this is referring to - any ideas? Thanks again for trying.
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi Wuffo,

In the properties panel for the row check under the Object-> Binding tab and there is a setting for the minimum, maximum, and initial number of repeatable rows. I think the default is 1 so you need to change it to the number you want, or leave it unchecked so any number of row can be added.Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com