These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

resolveNode does not work

oksana77
Registered: Apr 24 2009
Posts: 89
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");

My Product Information:
Acrobat Standard 8.1.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The only thing that could be wrong is that the path is wrong. For one thing, the beginning of your path is missing the DOM component.

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

oksana77
Registered: Apr 24 2009
Posts: 89
Thank you so much for your reply! I haven't been using a console window but this seems to be as a very good idea.
oksana77
Registered: Apr 24 2009
Posts: 89
Using $form worked perfectly! Thank you again!