xfa.resolveNode("xfa..someNode").rawValue returns null | Community
Skip to main content
Level 2
November 7, 2018
Solved

xfa.resolveNode("xfa..someNode").rawValue returns null

  • November 7, 2018
  • 3 replies
  • 3966 views

Hi

if have like this structure, where there is only one instance each:

ParentSubform

     ChildSubform

          MyTextfield.rawValue = 99999

now, i try to get that value in ParentSubform::initialize event:

var value = xfa.resolveNode("xfa..ChildSubform").MyTextfield.rawValue;

console.println("vlaue: " + value); // null

console.println("value: " + ChildSubform.MyTextfield.rawValue); // 99999

did I misunderstand the resolveNode function?

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by _Bruce_Robertson

The XFA object model is divided into a number of parts, the form is under xfa.form, the template under xfa.template, etc.  To use the descendent operator, the two dots ".." you have to say which model to look in.

Try

xfa.resolveNode("xfa.form..ChildSubform").MyTextfield.rawValue

or

using the shortcut

xfa.resolveNode("$form..ChildSubform").MyTextfield.rawValue

3 replies

radzmar
Level 10
November 7, 2018

I think there is no form object in yout form named „xfa“, isn't it? I this way the result „null“ is correct.

The correct script should propably be:

this.resolveNode("ChildSubform.MyTextfield").rawValue

Here's a very good explaination of how the resolveNode() and resolveNodes() methods work: resolveNode vs. resolveNodes

_Bruce_Robertson
_Bruce_RobertsonAccepted solution
Level 10
November 8, 2018

The XFA object model is divided into a number of parts, the form is under xfa.form, the template under xfa.template, etc.  To use the descendent operator, the two dots ".." you have to say which model to look in.

Try

xfa.resolveNode("xfa.form..ChildSubform").MyTextfield.rawValue

or

using the shortcut

xfa.resolveNode("$form..ChildSubform").MyTextfield.rawValue

Level 2
November 8, 2018

thanks for your answer, but xfa is the topmost node in xml based forms by default