Expand my Community achievements bar.

Automatically populating fields from repeatable subforms?

Avatar

Level 2

I have a flowed expandable subform with a table in it containing various fields.

I want a second positioned subform to automatically populate with the information from the expanding rows as the user adds information to the five allowed instances in the expandable subform.

How can I accomplish this in livecycle designer es4? Thanks.

5 Replies

Avatar

Level 7

It depends on where the information will come from.

If it will always come from the first 5 rows:

for (var i = 0; i<5 && i<xfa.resolveNode("Table1.Row1").instanceManager.count; i++)

     xfa.resolveNode("sfSecondSubform.tfExample"+i).rawValue = xfa.resolveNode("Table1.Row1["+i+"].tfExampleField").rawValue;

     //I don't know what you named your fields, so I'm going with tfExample0, tfExample1, etc.

Avatar

Level 2

The field in the first repeating subform is located in the heirarchy like this:

form1.MainForm.NamedInsured.SubformAppl.Applicants.Insureds.Table1.Row6.DDAmt

The field in the positioned nonrepeating subform (where I want the DDAmt to automatically appear for five instances is located here:

form.MainForm.SubformAppl.SummaryInsureds.Table.Row.SubtotalAmtDDAmt

Would you mind setting up the script using this? And where does the script belong? On the exit event of the DDAmt field in the first subform?

Thanks for this - I have been struggling with this for some time.

Avatar

Level 7

So, is the second set of instances (the ones that are being filled) in a table that is static? Or is it in a table with rows that are created as needed?

Can you take a screenshot of the heirarchy that shows both subforms with their respective paths?

hierarchy.png

Something like this.

Avatar

Level 2

screenshot1.jpgDo yscreenshot2.jpg

The second table (Summary Insureds) is static (ideally, it should also be an expanding subform, but I haven't been using livecycle designer long enough to have mastered this yet.).

If  you wouldn't mind, I could send you the form offline, if I haven't been clear enough about what I'm trying to do.

I entered the following script on the exit event of the Table.Row1.DDAmt  field:

for(var i=0;<5 &&

i(xfa.resolveNode("Table1.Row1").instanceManager.count; i++)

xfa.resolveNode("form1.MainForm.SubformAppl.SummaryInsureds.Table.Row1.SubtotalDDAmt"+i).rawValue=

xfa.resolveNode("form1.MainForm.SubformAppl.Applicants.detail.Insureds.Table1.Row6["+i+"].SubtotalDDAmt").rawValue;

I also tried the following FormCalc script on the calculate event of the SubtotalDDAmount field in the static table, but I know that it is catching only the first instance. Is there a way to modify the formcalc script so that it will repopulate the remaining fields with a new entry when a new instance is created?

$=form1.MainForm.SubformAppl.Applicants.detail.Insureds.Table1.Row6.DDAmt

Message was appended by: NellievD

Avatar

Level 7

Because of the fact that you have the other set of fields in a second table, the example I sent won't work. (I was presuming that they were just fields on the form somewhere else.

email me what you have: jasotastic at gmail dot com