Avatar

Level 10

Just looked at a couple of Data dom manipulation forms I have done before and I use

the following code:

var currentElement;
var obj;

//Get the nodes below the root node in the dataDom
obj = xfa.datasets.data.root.nodes;

//Set an initial value for the textField
TextField1.rawValue = "The values of the coap_flag are: ";

//Loop through the nodes in the obj set
for (i=0; i< obj.length ; i++){
//set the currentElement to the 1st child node
currentElement = obj.item(i);
//Check to see if it is an applicant node
if (currentElement.name == "applicant"){
  //It is an applican, now find the coap_flag node value and write it to the text field
  TextField1.rawValue += "\n" + xfa.resolveNode("xfa.datasets.data.root.applicant[" + i + "]").coap_flag.value;
}
}

In all my examples I always create an object then check the length of the object. I do not know why but it does work.

Paul