I am a novice form developer that cannot figure out how to get "xfa.form.remerge();" to work correctly. I have a form that contains three subforms with repeating instances. My goal is to create a reset button that will present a dialog box to the user to confirm the reset. If the user select "yes" I want all data cleared and the entire form set to its initial state. I am using the script below which clears the data but doesn't reset the subform instances back to its original state
On click*
var nButton = app.alert({
cMsg:"Warning: You are about to reset the order form data. \n\nDo you want to continue?",
cTitle: "You have clicked the reset button",
nlcon: 1, nType:2
});
if (nButton ==4)
{
xfa.host.resetData();
xfa.form.remerge();
}
The second obstacle I am trying to figure out is with the remove button within my repeating subforms. My current button works great except when there is only one instance with data. If I only have one instance with data the remove button does nothing. I am hoping to find way to have the "remove" button reset the current instance to initial state if only one instance is present but delete if more than one instance has been created
On click*
this.resolveNode('limited._order').removeInstance(this.parent.index);
if (xfa.host.version < 8) {
xfa.form.recalculate(1);
}
Any assistance will be greatly appreciated, below is a link to a sample of my form for reference