XFA Specification
Chapter 11, Forms That Initiate Interactions with Servers
Invoking ADO APIs Through the Source Set DOM
344
The
lockType
property governs locking of the data in the database while the client has the record set
open. The optimum value for this is determined by the data base design, the cursor type, and the nature
of the application.
The
max
property sets a limit for the number of records to be returned in the record set. When the value is
zero, as in the example, there is no limit.
The
bofAction
and
eofAction
properties control what the cursor does when a cursor positioning
command places the cursor at the beginning or end, respectively, of the record set. Using
bofAction
and
eofAction
the form can auto-insert a new record at the end, pre-position for insertion at the beginning,
and so on. With all these options available it is possible to make a form that accesses a database with a
minimum of scripting. Indeed in the example all of the scripts associated with each button are single
method invocations.
The select element
The
select
element contains a SQL select clause. This defines the set of records that belong to the record
set. In this case the selection is all columns from a table called
Contacts
.
The map element
A
map
element connects a column in the data base to a
bind
element in the source set. Note that it can
not connect directly to a
bind
element in the template.
In the example there are two columns of interest,
FirstName
and
LastName
.
The bind element
Columns in the record set must be mapped into the Data DOM so that the data can be processed there. In
the example there are two columns of interest,
FirstName
and
LastName
, and each is mapped via a
binding. Each of the bindings is identified by an XML ID so that a
map
element can make reference to it.
In the example the data in the current record is bound to nodes under
$record
. It is not automatic that
query data is located there. Rather the source set dictates where the query data will be located. However
it is convenient to use
$record
and this is frequently done. The relevant part of the source set is
highlighted below:
<source name="FFADOData1" db="customer">
<connect ...>...</connect>
<command ...>...</command>
<bind id="bind0"
ref="$record.contact.FirstName"/>
<bind id="bind1"
ref="$record.contact.LastName"/>
</source>
For each data item two bindings are necessary, one from the data base into the XFA Data DOM and
another from a field into the same node of the Data DOM. The binding of fields to nodes in the Data DOM
is controlled by the template, as shown in
“Fields bound to columns in the data base” on page 345.
Home Index Bookmark Pages
Pages: Home Index All Pages