Hello All,
I am trying to create an item subform based on the data in the XML, the item subform is reapeatable. I am using the code below to initiate the subform in the initialise event and fields to be displayed are under the ItemBody Subform.
var List = ref(xfa.datasets.data.Invoice.InvoiceDetail.ListOfInvoiceItemDetail)
for i=0 upto List.nodes.length step 1 do
_ItemBody.addInstance(1)
xfa.form.recalculate(1)
endfor
Can anyone suggest the steps to create the subforms dynamically via scripting(Using addinstance).
Regards,
Harry
Views
Replies
Total Likes
Hi,
In my experience you do not need to use script at all for this functionality.
Just make sure that the repeating object is set to repeat in the Object > Binding palette. Then when the data is imported the form will render the right amount of instances to suit the data being imported.
Does that make sense?
Niall
Views
Replies
Total Likes
Hi Niall,
I am trying to repeat the subform by duplicating it in the next page. All the header data is visible from the xml but the items appear only in the first subform, i was hoping to write a script to populate the subforms programmatically.
Regards,
Harry
Views
Replies
Total Likes