| |
What Is Data Binding?
Before we discuss the three components of the data binding architecture,
let's explain what is meant by the term binding.
Simply put, a binding expresses the relationship between the data supplied by a data source object and the
HTML consumer of the data. This relationship is called a binding because the
value of the datem (short for data item) is synchronized between the client and
the server. When an HTML consumerfor example, an HTML text
boxmodifies a datem, the modified datem is saved back to the data source object.
Conversely, if the data source object changes the data value, the modified
datem is sent to the data consumer. Generalizing further, multiple consumers can
be bound to the same datem, and all values of all consumers are synchronized
to the value supplied by the data source object. Values in the data source
object are bound to the values in one or more data consumers.
Two distinct styles of binding are available:
current record binding and repeated table
binding. Current record binding uses HTML elements to display
data from a single record from the data setthe current record. A different
record can then be made current, in which casethe elements are updated
dynamically to display the data from that record. Repeated table binding lets
you specify a set of bound elements, called a template, that is repeated once for
each record in the data set. Web authors also have the option of limiting the
number of records repeated in the table, a feature known as table paging.
Table paging and the two binding styles will be discussed in detail in the
section "Building Basic Pages Using Data Binding" later in this chapter. [Содержание]
|