Hi,
There are a few situations when you need to resolve a node.
- When you are referencing an object that has the same name as other objects in the same container. In the hierarchy you would see TextField1[0], TextField1[1], TextField1[2], etc. The number in square brackets shows the instance number of each object. If in your script you want to reference TextField1[2], then you would need to resolve the node. This is a good reason to name objects as you drag them onto the form.
- You are referencing an object that is in an unnamed container/page/subform. The script needs to resolve the unnamed container in order to access the object inside. This would also apply if there are several containers with the same name (see 1 above). Again, another good reason to name containers as you go.
- If you are trying to reference a particular instance in a repeating object, then you would need to resolve that particular instance. There are several examples of this in the table samples here: http://assure.ly/lwQHm7.
- If your script is in an object in the main mages and you are referencing an object on the Master Page (or visa versa), then you would need to resolve the node.
There are the main times you would resolve the node. There may be more, but I can't think of any at this stage.
Resolving nodes is particular to JavaScript scripts and not FormCalc scripts.
SOM stands for Scripting Object Model. XFA forms have a number of models.
In a form the top object is XFA. This stands for XML Forms Architecture.
Under this are a number of child objects in a strict hierarchy. These are referred to as DOMs or Document Object Models. There are the:
- XFA DOM. You would sometimes script against this model, for example, xfa.resolveNode().
- Template DOM, which contains information about the form.
- Data DOM, which holds information on the data structure and content.
- Form DOM, which contains the merged Template DOM and Data DOM. Most of the scripting is done against the Form DOM.
- Layout DOM, which contains page specific information for example xfa.layout.pageCount().
The Scripting Object Model (SOM) expressions allow you to access properties and methods.
This DRAFT form is a work in progress (I will eventually finish it): http://assure.ly/exTXaZ. The intention is to show how to build SOM expressions in different situations. At the moment it does not have any supporting text in it. Have a look at page 4 and over over the SOM expression.
I hope that helps,
Niall