Introduction to IE Data Binding - DHTML Lab | 9 | WebReference

Introduction to IE Data Binding - DHTML Lab | 9


Introduction to IE Data Binding

Changing the Current Record

In order to view the other records we need to utilise the recordset property exposed by the DSO. The recordset object itself exposes four more methods that we can use in navigation. The methods are fairly self-explanatory:

Makes the first record of the dataset the current record.

Makes the last record the current record.

Makes the next record the current record.

Makes the previous record the current record.

In our example, the code for moving to the beginning and end of the recordset is inline for brevity:

       ONCLICK="tdcStaff.recordset.MoveFirst();" VALUE=" << ">

However, moving to the next and previous records is performed in functions, as we must implement wrapping when the start or end of the recordset is passed. We can detect when end of the recordset is reached as the recordset property eof is set to true.

function moveNext()

Bindable HTML elements fall into two categories, single valued and tabular data consumers. In our first example, all of the data bound HTML elements fall into the category of single valued data consumers, as they require the combination of a DATASRC and a DATAFLD attribute to bind a column of a single record.

The <TABLE> element is slightly exceptional as it falls into the category of tabular data consumers, since it only requires a DATASRC. Tabular data consumers rely on the elements that they contain to bind to data columns from the DSO. We will develop another example to illustrate this on the next page.

Produced by Ian McArdle and Paul Thomas and

All Rights Reserved. Legal Notices.
Created: Oct 17, 2000
Revised: Oct 17, 2000