So you want to copy the information of each row unter DETAILS into the related row unter RETURN OF ITEMS I guess: Put this calculate script into the object "ReturnOfItems" an remove the other calculations script fromt the text fields.var nCount = _Enter1.count, // Count instances
oThat = this; // C...
Hi, there's another way to reset a form, which works better than resetData().Given the root node of you form is named "form1" than it looks this way.xfa.datasets.data.loadXML("<form1/>", true, true);
xfa.form.remerge();
You need to tell the form to start a recalculation, since this is only triggered automatically through changed values but not the presence of objects. Add this code to the existing script that controls the presence of your subforms. xfa.form.recalculate(true);
Keep in mind: To test for an empty field you better use the isNull method or the operator === instead of ==. The latter can create false positives since it doesn't compare the types of objects. if (pmp.Page1.object1.kpi1.isNull) {
// do something
}orif(pmp.Page1.object1.kpi1.rawValue === null) ...
You can do this the same way a the average calculations.var oNodes = pmp.resolveNodes("#subform[*].#subform[*].Table1.Row1.#field.[Exists($.ui.#choiceList) eq 1]");
for (var i = 0; i < oNodes.length; i += 1) {
oNodes.item(i).mandatory = pmp.Page1.object1.kpi1.isNull ? "error" : "disabled";
}
To have all instances of that dropdown with the same value, just set the binding to global and make sure each is named the same way. For the presence you would have to use additional scriptings to check the presence of a referenced dropdown and copy to all other instances of it. Can you provide a s...
The total average can be calculated the same way as shown above. You only need the set a different filter for the fields you're after. // Generic function to calculate average from numeric fields.
// If filters for any subform under pmp and any nested subform within which then includes a object Tabl...
Well, this is very bad style. There's no need to use scriptings to set the initial presence of objects. It also has two disadvantenges: If the user has no scriptings disabled the form has a wrong layout and the initial scriptings always "dirties" the form, so the user is always prompted to save chan...
The scripting syntax is different to that in Acrobat and there are two different scriting languages: FormCalc and JavaScript. Each of them has its benefits. For your average field you can use a combination of both. Put this JavaScript in the calculate event. It filters for all dropdown lists in the...