Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Text Field in Overflow Leader - Global Binding within Subform Only?

Avatar

Level 4

I have a form with a repeatable subform which contains another repeatable subform within it. The inside subform has a header row which contains a text field that the user enters data in. This header row is set up as a overflow leader so that it will repeat when the inside subform breaks to another page.

The problem is that if I do not set the text field in this header row to Global, it does not retain the data typed into it, and defaults to the "Rep ID#" default value. However, if I DO change it to Global, it works for the first subform, but I need my subsequent subforms to have a different Rep ID #, and when set to Global, they are set to the same Rep ID # as the first subform.

How do I get around this? I only need the Rep ID # Field to have Global binding within the subform within which it is contained, not throughout the entire form. See screenshot below:

Clipboard01.gif

Any ideas?

Thanks,

Jo

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hmmm,

I was right, it was tricky (or I am getting slow).

https://acrobat.com/#d=r3jjZgsZQ0O*sqJIsuPfvw

This is FormCalc in the initialize event of the rep repeating object:

var i = rep.index

columnHeader.repID = rep[i].columnHeader[0].repID

Seems to work as intended.

Niall

View solution in original post

6 Replies

Avatar

Level 10

Hi,

Tricky!

Effectively, the overflow leader is a new instance of the columnHeader object, therefore it is defaulting to the default value.

The Global property is... global!

A couple of potentials:

(1) In the calculate event of the repID object have the following FormCalc:

$ = columnHeader[0].repID

(2) If the repID is set to Global, then on the initilize event you could try setting the name of the repID object, to include the subform instance. So the following in JavaScript:

this.name = repID + this.parent.parent.index.toString();

The number of .parent would depend on your form structure.

Not sure will these work, but it might be worth a go.

Niall

Avatar

Level 4

Thank you for helping with this Niall.

With the first option, if I add the calculation to the repID object, it changes the value type to Calculated, and does not allow the user to change it (to an actual User ID #).

With the second option, no matter how many .parent I have, changing repID to Global still changes the field in every rep subform.

Tricky indeed!

Can you think of anything else I could try?

Thanks,


Jo

Avatar

Correct answer by
Level 10

Hmmm,

I was right, it was tricky (or I am getting slow).

https://acrobat.com/#d=r3jjZgsZQ0O*sqJIsuPfvw

This is FormCalc in the initialize event of the rep repeating object:

var i = rep.index

columnHeader.repID = rep[i].columnHeader[0].repID

Seems to work as intended.

Niall

Avatar

Level 4

Amazing...works PERFECTLY...thank you sir!!!

Jo