Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How do I copy a table with expandable rows to another table?

Avatar

Avatar
Level 1
MelJen
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
MelJen
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile
MelJen
Level 1

05-08-2015

I have a page containing fields in a table with Add and Delete buttons to add and delete rows:


 

I want to copy the fields table into another table on a page that will be printed:

Can anyone help me with the scripting?

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 1
areddingICF
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
areddingICF
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile
areddingICF
Level 1

07-08-2015

I had a similar table where I was archiving rows "deleted" from one table and moving them to another table.  I used this code on the click event of the delete button:

(this code adds a new row to the second table and copies the data from the current row to the old row)

var newRow = this.resolveNode('Page2.Table1._Row1').addInstance(1);

if (xfa.host.version < 😎 { xfa.form.recalculate(1);}

newRow.Name.rawValue = this.resolveNode("Name").rawValue;

newRow.Type.rawValue = this.resolveNode("Type").rawValue;

newRow.Status.rawValue = this.resolveNode("Status").rawValue;

I also used a variation of this on the exit event of the last field in each row to add a row to a table and copy the data over.  If you do that though, it adds a new row every time you exit the field - you would have to write more code to check if the data changed before you add the row and probably something else to address deleted rows if that's an issue for you.  Hope it helps.