Avatar

Level 10

Your assumption might not be coreect.

You can add an instance and still display value in the newly added field at the same time.

For example

     If you have a subform "Subform1" and inside the subform you have "TextField1". You want to populate the value of the TextField1 from TextField2.

     For Subform1, you set the "Repeat Subform for Each Data Item".

     Now you are adding new instance of Subform1 and want to display TextField1 with TextField2 data.

     The below code you can place in the click event of button while adding the new Instance.

     Subform1.instanceManager.addInstance(1);

     var intIndex = Subform1.instanceManager.count-1;

     //Resolve the Subform1 to the recently added instance and display the value.

     xfa.resolveNode("Subform1[" + intIndex + "]").TextField1.rawValue = TextField2.rawValue;

     The key here is to resolve the node to the recently added instance.

Hope this gives an idea.

Thanks

Srini

Note: TextField1 and TextField2 both are set to Normal/ None binding in the above example.