Binding RDS Search Results to a Table Using DHTML

When RDS returns data from the SQL database, the data is displayed by being bound to the DHTML TBL_SearchResults table built in the DSearch.asp file. This file is also included in Library.asp. The result is that this bound table is the only user-interface element that changes. The use of the invisible IFrame allows the screen to be updated with a minimum of visual change for the library user.

The following code, from DSearch.asp, shows the creation of the table to which the search results returned by RDS are bound. This code uses the DATASRC attribute, a DHTML data-binding extension. The syntax for this extension requires that the pound sign (#) precede the name of the data source. In this case the data source has been defined in the instantiation of the RDS object to be RDS_SearchResults.

<div ID="SearchResults" STYLE="DISPLAY: none; LEFT: 265px; POSITION: absolute; TOP: 110px">
   <table ID="TBL_SearchResults" BORDER=0 CELLSPACING=2 CELLPADDING=0 COLS=2
          DATASRC="#RDS_SearchResults" DATAPAGESIZE=5>
   <tbody>
      <tr><td COLSPAN=2><a DATAFLD="Link"><span CLASS=Title DATAFLD="Title"></span></a></td></tr>
      <tr><td WIDTH="50%">Call#: <span DATAFLD="Call"></span></td><td>Published: <span DATAFLD="Pubdate"></span></td></tr>
   </tbody>
   </table>
</div>

Note  Data that is bound to DHTML elements cannot be intercepted or modified as it is displayed. Because of this, RDS queries must perform the necessary data manipulation and formatting before the data is returned to the client. For more information about the strengths and weaknesses of RDS, see Overview of RDS in the next section.

After search results are displayed, they are not lost or discarded. During the current session, users can use the Back button on the Microsoft Internet Explorer toolbar to review search results from previous searches. The CML file TableMgr.asp controls this functionality.