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

Multiple pages with Subforms

Avatar

Level 2

Hello all,

Have a requirement where the page 1 has to be repeated in otherwords Page1 will be english and Page 2 will be french.(the underlying fields to be displayed in both languages will be same but there labels will be different for each language) I am using just one master page with its default content area. The layout will look something like below.

Form Overview.jpg

The content of subform English is flowed (top to Bottom), All the subforms within this subform are positioned and the ItemBody has "Allow Page Breaks within Content" checked as it is repeatable. With this configuration the output is perfect with multiple pages(when they are items over the first page).

To get the French as the next page am duplicating the English subform, the problem with this is

1. Some data which appears in the Headerform for english does not appear in french, if I write a calculation script it works fine. I might have got some basic properties wrong.

2. The Items display is good for English but not even one item appears for French.

Am using a local XSD as the data connection.

Appreciate if someone can help me with the basic design for my requirement or any suggestions.

Regards,

Harry

1 Accepted Solution

Avatar

Correct answer by
Level 2

Finally found the solution.

I changed the binding for first ItemBody to InvoiceDetail.ListOfInvoiceItemDetail.InvoiceItemDetail[*]

in the calculate event of the second ItemBody wrote the script below

_ItemBody.setInstances(English._ItemBody.count)

In calculate event of each field the script below

$.rawValue = xfa.form.Invoice.Root.English.ItemBody.SellerLineItemNum.rawValue


View solution in original post

5 Replies

Avatar

Level 2

Hello all,

I was able to fix the first issue by changing the binding, somehow when the 2nd page is rendering it does not like references with "[*]", which defines multiple occurences of the same field. Removing "[*]" in the binding worked out, Example instead of binding as

InvoiceHeader.InvoiceReferences[*].PurchaseOrderReference.PurchaseOrderNumber.Reference.RefNum

changed it to

InvoiceHeader.InvoiceReferences.PurchaseOrderReference.PurchaseOrderNumber.Reference.RefNum

this worked.

But am still having problem with displaying the items, can only get the PDF to show one item, this also achieved by removing "[*]".

Has anyone experienced this kind of an issue.

Regards,

Harry

Avatar

Level 2

The problem with the displaying the items in next page is, once the pdf is rendered with the item binding it has finished populating the English form.when it comes to the French form it does not know the index of the first item since it has already reached the last index of item in the English form.

Is there a way to reset this data binding counter for multiple occurences to same node in different subforms?

Avatar

Level 2

I came across this blog which is exactly what I am trying to do.

http://blogs.adobe.com/formfeed/2010/05/duplicating_subform_structures .html

My form looks like this

Form Overview2.jpg

I am using the script in calculate event for ItemBody in the French Subform by making a change to the line as below

match(this, English.dataNode.resolveNodes("$.*"));

but it is still not working any suggestions

Avatar

Correct answer by
Level 2

Finally found the solution.

I changed the binding for first ItemBody to InvoiceDetail.ListOfInvoiceItemDetail.InvoiceItemDetail[*]

in the calculate event of the second ItemBody wrote the script below

_ItemBody.setInstances(English._ItemBody.count)

In calculate event of each field the script below

$.rawValue = xfa.form.Invoice.Root.English.ItemBody.SellerLineItemNum.rawValue


Avatar

Level 2

There is other things you have to do, setup the min count to 1 for the subform.