Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

New instance of table section

Avatar

Level 9

I have two table rows (row 2 and 3) combined as a section. When I use the following script, LiveCycle only creates a new instance of row 3 instead of creating a new instance of the section (both rows 2 and 3). What am i doing wrong? (The section is named 'ActionItem1 in Table1)

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

if (xfa.host.version < 8) {

xfa.form.recalculate(1);

}

1 Accepted Solution

Avatar

Correct answer by
Level 10

You should be able to recreate what you're doing with subforms, tables are just specialized subforms. Create subforms for your headers, rows, etc. I've built a few tables that way.

View solution in original post

8 Replies

Avatar

Level 10

Hi,

You would need another addInstance() method call for the other row, but in that case the rows will not be next to each other.  You will get all the ActionItem1 rows together and then whatrever you called the other row.  You may be better off using a repeating subform which will give you more control of the layout of the "table".

Regards

Bruce

Avatar

Level 9

Bruce,

Thanks for your reply. To keep the rows together you mentioned a repeating subform. Do you mean to place a separate table in a repeating subform? As far as i knowm I can't wrap the two rows of a table into a subform, right?

Thanks again!

~Don

Avatar

Level 10

Hi Don,

I was thinking it might be easier to replace the table totally with a repeating subform.  Seems to give you more control, but you don't get things like repeating headers on subsequent pages.

But that might not suit your case.  Does row2 and row3 have "Repeat row for each data item" set, in which case does row2 have a min count, if it is zero then it probably wont be rendered.

Bruce

Avatar

Level 10

You don't get repeating headers per se but you can use an Overflow Leader or Trailer for subforms.

Avatar

Level 9

I'm surprised that I can't lock two (or more) table rows together and script a new instance of that group. Unfortunately, the subform idea won't suit what i am trying to do.

Thanks for the responses. I really appreciate it.

Avatar

Correct answer by
Level 10

You should be able to recreate what you're doing with subforms, tables are just specialized subforms. Create subforms for your headers, rows, etc. I've built a few tables that way.

Avatar

Level 9

Okay Jono,

I will give it another try and report back later.

Thanks again.

~Don

Avatar

Level 9

Yes - that will work after all by using overflow leaders and trailers.

Thanks!

~Don