Chapter 4, Exchanging Data Between an External Application
and a Basic XFA Form
XFA Specification
Basic Data Binding to Produce the XFA Form DOM
176
Binding to a field with a multi-select choice list
dough
dough
dough
grains
grains
“rye
barley
wheat”
grains
items
items
text
“wheat”
text
“wheat”
(any name)
“rye”
text
“rye”
text
“rye”
(any name)
“barley”
text
“millet”
text
“millet”
(any name)
“wheat”
Explicit Data References
It is possible for the template to override the automatic matching process. When a field, exclusion group,
or subform has a
bind
property with a
match
attribute having a value of
dataRef
, the accompanying
ref
attribute supplies a SOM expression which points directly to a data node. Because a SOM expression
can point any place in the Data DOM, the referencing node can bind to any data node of the appropriate
type in the Data DOM, regardless of its own location in the Form DOM. If there is no data node matching
the expression, the binding process creates one with default properties. If the expression specifies
ancestor data nodes that do not exist, they too are created so that the referenced data node can link into
the Data DOM at the specified location.
When an explicit data reference is supplied, the SOM expression must expand unambiguously to one data
node, that is, it must not contain ".." or "*". The latter restriction is necessary because the expression may be
used not only to identify an existing node but to create a new node.
When a form node supplies an explicit data reference, the data binding process does not use the
name
attribute of the form node. For this reason the name can be omitted for such form nodes (i.e. they can be
made nameless) without becoming transparent.
The
ref
attribute may point to a data node which is already bound to some other field or exclusion group.
When multiple fields or exclusion groups bind to the same data value the result is that they share the same
data. If any one of them is updated they are all updated. The situation is different when multiple subforms
bind to the same data group. In this case, assuming the children of the subforms do not employ explicit
data references, the children still bind to unique data nodes, even if they share the same names. This
happens because ordinary binding always excludes data nodes which are already bound.
Home Index Bookmark Pages
Pages: Home Index All Pages