Answered
I am trying to get total from "tcol" subform and REPORT number 1, but this line doesn't work.
var tot1 = xfa.resolveNode("form1.REPORT[" + 0 + "].page1.tcol.row[" + this.parent.index + "].totals").rawValue;
Here is a complete Script:
form1.REPORT.page1.tcol.row.totals::calculate - (JavaScript, client)
var sCount = _REPORT.count;
if(sCount > 1 && this.parent.parent.parent.index == 1)
{
var tot2 = Scripts.totNum("sub.rows[*].row4-18.col[" + this.parent.index + "].cell");
var tot1 = xfa.resolveNode("form1.REPORT[" + 0 + "].page1.tcol.row[" + this.parent.index + "].totals").rawValue;
this.rawValue = tot2+tot1;
}
else if(sCount == 1)
this.rawValue = Scripts.totNum("sub.rows[*].row4-18.col[" + this.parent.index + "].cell");
Try this:
xfa.form.resolveNode(...);
or you can start the path with an explicit reference to the top of the form hierarchy. This way "resolveNode" can be called from any node.
this.resolveNode("$form.form1 ....");
Also, you should be trying these things out in the JavaScript Console window before coding them into the form. You would have found this error right away if you had be using the Console.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script