home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2003 March / DPPCPRO0303.ISO / Components / Microsoft ASP / _SETUP.1 / MSDBList.inc < prev    next >
Encoding:
Text File  |  1998-11-20  |  21.0 KB  |  580 lines

  1. <SCRIPT RUNAT=SERVER LANGUAGE=JSCRIPT>
  2. <!--#INCLUDE FILE="MSGlobal.inc"-->
  3. ////////////////////////////////////////////////////////////////////
  4. //                                                                //
  5. //   NetObjects Fusion ASP Components                                  //
  6. //   Custom JScript Object: MSDBList                           // 
  7. //                                                                //
  8. ////////////////////////////////////////////////////////////////////
  9. /*
  10. Object:       MSDBList  
  11.  
  12. Version:      1.0 9/16/97
  13.  
  14. Written By:   Application Methods, Inc.
  15.               6300 Southcenter Blvd.
  16.               Seattle, WA 98188
  17.               (206) 244-2400
  18.               http://www.appmethods.com
  19.  
  20. Description:  The MSDBList object is responsible for displaying the selected results of 
  21.    a query in table format.  Properties of the MSDBList controls such things as the displayed
  22.    fields, field labels, hyperlink field, hyperlink key values, and various other layout 
  23.    and format attributes.
  24.  
  25. Note:   Generation of a number of hidden fields is necessary to pass information
  26.    on to other components.  All hidden fields created by this object are prefixed
  27.    with 'amaspHidden_' or 'amaspField_'.  Devlopers should never create
  28.    any form element with these prefixes or unexpected results will occur.
  29.  
  30. Properties:
  31.    queryComponent - Name of Query component used by the MSDBList component
  32.    navComponent - Name of Nav component which navigates the list
  33.    hyperlinkField - Field on which the hyperlink is placed (Field should be listed in fieldNames list<enforced>))
  34.    hyperlinkPage - Page to which the link jumps
  35.  
  36.    labelBold - Is label text bold?
  37.    labelItalic - Is label text italic?
  38.    labelUnderline - Is label text underlined?
  39.    labelSize - Label text size
  40.    labelFont - Label text font name
  41.    labelTextColor - Label text color
  42.  
  43.    dataBold - Is data text bold?
  44.    dataItalic - Is data text italic?
  45.    dataUnderline - Is data text underlined?
  46.    dataSize - Data text size
  47.    dataFont - Data text font name
  48.    dataTextColor - Data text color
  49.  
  50.    cellPadding - Table cell padding
  51.    cellSpacing - Table cell spacing
  52.    borderSize - Table border size
  53.    tableWidth - Total width of Table
  54.  
  55.    keyFieldCount - Count of key fields 
  56.    keyFieldNames - Name of key fields
  57.    keyFieldLabels - Label of key fields. Replaces key field name in URL 
  58.    keyFieldDataType - Data type of key fields
  59.    
  60.    fieldCount - Count of fields to display (must be less than number of fields selected in query <not-enforced>)
  61.    fieldNames - Name of fields (must be selected from available fields in query component <not-enforced>)
  62.    fieldLabels - Field Labels for each field
  63.  
  64. Methods:
  65.    emitTableHeader - Opens table, sets formatting, outputs table field labels, always successful
  66.    emitTableBody - Writes out data, possibly successful
  67.    emitTableFooter - Closes table, always successful
  68.  
  69. Usage:  The following displays a list of records from the Orders table
  70. <HTML>
  71. <HEAD>
  72.  
  73. <!SCRIPT RUNAT=SERVER LANGUAGE=JSCRIPT>
  74.  
  75.  // Create and connect the database object
  76.  MSDBConnection1 = new MSDBConnection("test", "ODBC","MS Access", "Northwind","admin","",false);
  77.  MSDBConnection1.connect();
  78.  
  79.  // Create the query object
  80.  MSDBQuery1 = new MSDBQuery("MSDBQuery1", "MSDBConnection1", false, "*", "Orders", "", "OrderDate");
  81.  
  82.  //Create necessary field arrays for MSDBList component
  83.  MSDBList1keyFieldNames = new Array(1);
  84.  MSDBList1keyFieldLabels = new Array(1);
  85.  MSDBList1keyFieldDataTypes = new Array(1); 
  86.  
  87.  MSDBList1keyFieldNames[0] = "OrderID";
  88.  MSDBList1keyFieldLabels[0] = "OrderID";
  89.  MSDBList1keyFieldDataTypes[0] = "number";
  90.  
  91.  MSDBList1fieldNames = new Array(3);
  92.  MSDBList1fieldLabels = new Array(3); 
  93.  
  94.  MSDBList1fieldNames[0] = "OrderID"
  95.  MSDBList1fieldLabels[0] = "Order ID"
  96.  MSDBList1fieldNames[1] = "Customer"
  97.  MSDBList1fieldLabels[1] = "Customer"
  98.  MSDBList1fieldNames[2] = "OrderDate"
  99.  MSDBList1fieldLabels[2] = "Order Date"
  100.  
  101.  //Construct MSDBList component
  102.  MSDBList1 = new MSDBList(
  103.                 "MSDBQuery1",
  104.                 "",
  105.                 "OrderID",
  106.                 "../index.asp",
  107.                 true,
  108.                 false,
  109.                 false,
  110.                 "+0",
  111.                 "Times New Roman",
  112.                 "black",
  113.                 false,
  114.                 false,
  115.                 false,
  116.                 "+0",
  117.                 "Times New Roman",
  118.                 "black",
  119.                 1,
  120.                 3,
  121.                 2,
  122.                 505,
  123.                 1,
  124.                 MSDBList1keyFieldNames,
  125.                 MSDBList1keyFieldLabels,
  126.                 MSDBList1keyFieldDataTypes,
  127.                 3,
  128.                 MSDBList1fieldNames,
  129.                 MSDBList1fieldLabels
  130.  );
  131. <!/SCRIPT>
  132.  
  133. </HEAD>
  134. <BODY>
  135.  
  136. <%
  137.  MSDBConnection1.render()
  138.  
  139.  ' Automatically render list
  140.  MSDBList1.render()
  141.  
  142.  ' -OR- Manually render list
  143.  MSDBList1.emitTableHeader()
  144.  MSDBList1.emitTableBody()
  145.  MSDBList1.emitTableFooter()
  146. %>
  147.  
  148. </BODY>
  149. </HTML>
  150.  
  151. =====================================================================*/
  152.  
  153. //
  154. // MSDBList Object Constructor
  155. //
  156. function MSDBList (queryComponent, navComponent, hyperlinkField, hyperlinkPage, 
  157.                labelBold, labelItalic, labelUnderline, labelSize, labelFont, labelTextColor,
  158.                dataBold, dataItalic, dataUnderline, dataSize, dataFont, dataTextColor, 
  159.                cellPadding, cellSpacing, borderSize, tableWidth,
  160.                keyFieldCount, keyFieldNames, keyFieldLabels, keyFieldDataTypes,
  161.                fieldCount, fieldNames, fieldLabels) 
  162. {
  163.  
  164.    // Properties
  165.    this.queryComponent = (queryComponent != null) ? queryComponent : "";
  166.    this.navComponent = (navComponent != null) ? navComponent : "";
  167.    this.hyperlinkField = (hyperlinkField != null) ? hyperlinkField : "";
  168.    this.hyperlinkPage = (hyperlinkPage != null) ? hyperlinkPage : "";
  169.    
  170.    //Label text format properties
  171.    this.labelBold = (labelBold != null) ? labelBold : false;
  172.    this.labelItalic = (labelItalic != null) ? labelItalic : false;
  173.    this.labelUnderline = (labelUnderline != null) ? labelUnderline : false;
  174.    this.labelSize = (labelSize != null) ? labelSize : "0";
  175.    this.labelFont = (labelFont != null) ? labelFont : "";
  176.    this.labelTextColor = (labelTextColor != null) ? labelTextColor : "black";
  177.  
  178.    //Data text format properties
  179.    this.dataBold = (dataBold != null) ? dataBold : false;
  180.    this.dataItalic = (dataItalic != null) ? dataItalic : false;
  181.    this.dataUnderline = (dataUnderline != null) ? dataUnderline : false;
  182.    this.dataSize = (dataSize != null) ? dataSize : "0";
  183.    this.dataFont = (dataFont != null) ? dataFont : "";
  184.    this.dataTextColor = (dataTextColor != null) ? dataTextColor : "black";
  185.  
  186.    //Table format properties
  187.    this.cellPadding = (cellPadding != null) ? cellPadding : 0;
  188.    this.cellSpacing = (cellSpacing != null) ? cellSpacing : 0;
  189.    this.borderSize = (borderSize != null) ? borderSize : 0;
  190.    this.tableWidth = (tableWidth != null) ? tableWidth : 0;
  191.    
  192.    
  193.    //Key field properties
  194.    this.keyFieldCount = (keyFieldCount != null) ? keyFieldCount : 0;
  195.    if (keyFieldNames != null) {
  196.       this.keyFieldNames = keyFieldNames
  197.    }
  198.    else {
  199.       this.keyFieldNames = new Array();
  200.       for (var i = 0; i < keyFieldCount - 1; i++) this.keyFieldNames[i]="";
  201.    }
  202.          
  203.    if (keyFieldLabels != null) {
  204.       this.keyFieldLabels = keyFieldLabels;
  205.    }
  206.    else {
  207.       this.keyFieldLabels = new Array();
  208.       for (var i = 0; i < keyFieldCount - 1; i++) this.keyFieldLabels[i]="";
  209.    }
  210.    
  211.    if (keyFieldDataTypes != null) {
  212.       this.keyFieldDataTypes = keyFieldDataTypes;
  213.    }
  214.    else {
  215.       this.keyFieldDataTypes = new Array();
  216.       for (var i = 0; i < keyFieldCount - 1; i++) this.keyFieldDataTypes[i]="";
  217.    }
  218.  
  219.    //Display field properties
  220.    this.fieldCount = (fieldCount != null) ? fieldCount : 0;
  221.    if (fieldNames != null) {
  222.       this.fieldNames = fieldNames;
  223.    }
  224.    else {
  225.       this.fieldNames = new Array();
  226.       for (var i = 0; i < fieldCount; i++) fieldNames[i] = "";
  227.    }
  228.  
  229.    if (fieldLabels != null) {
  230.       this.fieldLabels = fieldLabels;
  231.    }
  232.    else {
  233.       this.fieldLabels = new Array();
  234.       for (var i = 0; i < fieldCount; i++) fieldLabels[i] = "";
  235.    }
  236.    
  237.    this.hyperlinkError = false;
  238.  
  239.    // Methods
  240.    this.render = liRender;
  241.    this.emitTableHeader = liEmitTableHeader;
  242.    this.emitTableRow = liEmitTableRow;
  243.    this.emitTableBody = liEmitTableBody;
  244.    this.emitTableFooter = liEmitTableFooter;
  245.    this.checkFieldErrors = liCheckFieldErrors;
  246.    
  247.    this.emitProperties = liEmitProperties;  
  248.  
  249.    // Increment global cursor usage counter since this component will try to use the cursor
  250.    incCursorCallCount();
  251.    
  252. } // END MSDBList constructor
  253.  
  254.  
  255. //
  256. // Checks for field names, key field names, and hyperlink fields not present
  257. // in query, returns a list of printable errors if found, "" if not found.
  258. //
  259. function liCheckFieldErrors () {
  260. //debug("Searching for field errors")
  261.   
  262.  var arrayObjectName = new Array();
  263.        
  264.     var errorMsg="";
  265.     var fieldError = true;
  266.     this.hyperlinkError = false;
  267.    
  268.     var fcnt;
  269.     var ccnt;
  270.  
  271.    //Check field name existance
  272.    //debug("searching fields");
  273.    for (fcnt = 0; fcnt < this.fieldCount; fcnt++) {
  274.       fieldError=true;
  275.       if (this.fieldNames[fcnt] != "") {
  276.          // flip though existing cursor fields looking for a match
  277.          for (ccnt = 0; ccnt < this.theCursor.Fields.Count; ccnt++) {
  278.             
  279.             if (this.theCursor.Fields(ccnt).name.toUpperCase() == this.fieldNames[fcnt].toUpperCase()) {
  280.             fieldError=false;
  281.             } // end if
  282.           } // end if fields for
  283.        }
  284.        else {
  285.          //debug("blank field error found");
  286.          errorMsg += "\n<TR><TD COLSPAN="+this.fieldCount+">***Warning: Field name " + fcnt + " is blank</TD></TR>";
  287.          fieldError = false;
  288.        }
  289.        if (fieldError) {
  290.          //debug("field error found");
  291.          errorMsg += "\n<TR><TD COLSPAN="+this.fieldCount+">***Warning: Field name: '" + this.fieldNames[fcnt] + "' not found in query</TD></TR>";
  292.       }
  293.    } 
  294.    
  295.    //Check key field name existance
  296.    //debug("searching key fields")
  297.    for (fcnt = 0; fcnt < this.keyFieldCount; fcnt++) {
  298.       fieldError = true;
  299.       if (this.keyFieldNames[fcnt] != "") {
  300.          // Flip through existing cursor fields looking for match 
  301.          for (ccnt = 0; ccnt < this.theCursor.Fields.Count; ccnt++) {
  302.             if (this.theCursor.Fields(ccnt).name.toUpperCase() == this.keyFieldNames[fcnt].toUpperCase()) fieldError=false;
  303.          }
  304.       }    
  305.       else {
  306.          //debug("blank key field error found");
  307.          errorMsg += "\n<TR><TD COLSPAN=" + this.fieldCount + ">***Warning: Hyperlink key field name " + fcnt + " is blank</TD></TR>";
  308.          fieldError = false;
  309.          this.hyperlinkError = true;
  310.       }
  311.        if (fieldError) {
  312.          //debug("key field error found");
  313.          errorMsg += "\n<TR><TD COLSPAN=" + this.fieldCount + ">***Warning: Hyperlink key field name" + fcnt + ": '" + this.keyFieldNames[fcnt] + "' not found in query</TD></TR>";
  314.          this.hyperlinkError = true;   
  315.        }
  316.    } 
  317.  
  318.    // if no hyperlink field or page specified, don't print jump
  319.        if (this.hyperlinkPage == "") this.hyperlinkError = true;
  320.  
  321.    //Check hyperlink field name existance
  322.       if (!this.hyperlinkError) {
  323.           //debug("searching hyperlink field");
  324.           fieldError=true;
  325.           if (this.hyperlinkField != "") {
  326.              for (ccnt = 0; ccnt < this.theCursor.Fields.Count; ccnt++) {
  327.                 if (this.theCursor.Fields(ccnt).Name.toUpperCase() == this.hyperlinkField.toUpperCase()) fieldError=false;
  328.              }
  329.           }
  330.           else {
  331.              //debug("blank hyperlink field error found");
  332.              errorMsg += "\n<TR><TD COLSPAN=" + this.fieldCount + ">***Warning: Hyperlink field name is blank</TD></TR>";
  333.              this.hyperlinkError = true;   
  334.              fieldError = false;
  335.           }
  336.           if (fieldError) {
  337.              //debug("hyperlink field error found");
  338.              errorMsg += "\n<TR><TD COLSPAN=" + this.fieldCount + ">***Warning: Hyperlink field name" + fcnt + ": '" + this.keyFieldNames[fcnt] + "' not found in query</TD></TR>";
  339.              this.hyperlinkError = true;   
  340.           }
  341.        }
  342.        
  343.    //debug("Error search complete");
  344.    return errorMsg;
  345. }  // END liCheckFieldErrors
  346.  
  347.  
  348. //
  349. // Writes out HTML that displays all of the list's properties
  350. //
  351. function liEmitProperties () {
  352.       //debug("Writing MSDBList properties...");
  353.       write("\n<BR><B>MSDBList Properties:</B>");
  354.       write("\n<BR>queryComponent = " + this.queryComponent);
  355.       write("\n<BR>navComponent = " + this.navComponent);
  356.       write("\n<BR>hyperlinkField = " + this.hyperlinkField);
  357.       write("\n<BR>hyperlinkPage = " + this.hyperlinkPage);
  358.       
  359.       write("\n<BR>labelBold = " + this.labelBold);
  360.       write("\n<BR>labelItalic = " + this.labelItalic);
  361.       write("\n<BR>labelUnderline = " + this.labelUnderline);
  362.       write("\n<BR>labelSize = " + this.labelSize);
  363.       write("\n<BR>labelFont = " + this.labelFont);
  364.       write("\n<BR>labelTextColor = " + this.labelTextColor);
  365.       
  366.       write("\n<BR>dataBold = " + this.dataBold);
  367.       write("\n<BR>dataItalic = " + this.dataItalic);
  368.       write("\n<BR>dataUnderline = " + this.dataUnderline);
  369.       write("\n<BR>dataSize = " + this.dataSize);
  370.       write("\n<BR>dataFont = " + this.dataFont);
  371.       write("\n<BR>dataTextColor = " + this.dataTextColor);
  372.  
  373.  
  374.       write("\n<BR>cellPadding = " + this.cellPadding);
  375.       write("\n<BR>cellSpacing = " + this.cellSpacing);
  376.       write("\n<BR>borderSize = " + this.borderSize);
  377.       write("\n<BR>tableWidth = " + this.tableWidth);
  378.       
  379.       write("\n<BR>keyFieldCount = " + this.keyFieldCount);
  380.       write("\n<BR>fieldCount = " + this.fieldCount);
  381.       var i;
  382.       for (i = 0; i < this.keyFieldCount; i++) {
  383.          write("\n<BR>keyFieldNames" + i + " = " + this.keyFieldNames[i]);
  384.          write("\n<BR>keyFieldLabels" + i + " = " + this.keyFieldLabels[i]);
  385.          write("\n<BR>keyFieldDataTypes" + i + " = " + this.keyFieldDataTypes[i]);
  386.       }
  387.  
  388.       for (i=0; i<this.fieldCount; i++) {
  389.          write("\n<BR>FieldNames " + i + " = " + this.fieldNames[i]);
  390.          write("\n<BR>FieldLabels " + i + " = " + this.fieldLabels[i]);
  391.       }
  392.       write("<BR>");
  393. }  // END liEmitProperties
  394.  
  395.  
  396. //
  397. // Writes out HTML that displays the entire list
  398. //
  399. function liRender () {
  400.    this.emitTableHeader(); 
  401.    this.emitTableBody();
  402.    this.emitTableFooter(); 
  403.    
  404.    // Decrement global cursor usage counter since this component has tried to use the cursor
  405.    // If the counter has reached zero after doing so, then this is the last cursor using
  406.    // component on the page, so call the DBQuery object's "cursorClose()" method to close
  407.    // the cursor if it's still open.
  408.    decCursorCallCount(this.queryComponent);
  409.  
  410. }  // END liRender
  411.  
  412.  
  413. //
  414. // Writes out HTML that displays the list's header
  415. //
  416. function liEmitTableHeader () {
  417.    //debug("Writing table header...");
  418.    write("\n<TABLE CELLPADDING="+this.cellPadding+" CELLSPACING="+this.cellSpacing+" BORDER="+this.borderSize)
  419.    write(" WIDTH="+this.tableWidth+">");    
  420.    write("\n<THEAD>");
  421.    
  422.    for (var i = 0; i < this.fieldCount; i++) {
  423.       var fieldWidth = 0;
  424.       if (this.fieldCount > 0) fieldWidth = this.tableWidth/this.fieldCount;
  425.       if (fieldWidth > 0) 
  426.          write("\n<TD WIDTH = "+fieldWidth+" >");
  427.       else 
  428.          write("\n<TD>");
  429.  
  430.       write("<FONT COLOR=" + this.labelTextColor + " SIZE=\""+this.labelSize+((this.labelFont != null) ? "\" FACE=\""+this.labelFont+"\"":"")+">");
  431.       if (this.labelUnderline) write("<U>");
  432.       if (this.labelBold) write("<B>");
  433.       if (this.labelItalic) write("<I>");
  434.       
  435.       write(this.fieldLabels[i]);
  436.       
  437.       if (this.labelItalic) write("</I>");
  438.       if (this.labelBold) write("</B>");
  439.       if (this.labelUnderline) write("</U>");
  440.       write("</FONT>");
  441.       write("</TD>");
  442.     }
  443.    write("\n</THEAD>");
  444.  
  445. }  // END liEmitTableHeader
  446.  
  447.  
  448. //
  449. // Builds and writes out HTML that displays the current list row
  450. //
  451. function liEmitTableRow () {
  452.    var LinkStr="";
  453.    var pre = "amaspHidden_"; 
  454.    var fieldPre = "amaspField_";  // Prefix that indicates the field is a database field to be
  455.                                        // used generally in the where clause of an SQL statement
  456.     
  457.    for (var i=0; i<this.fieldCount; i++) {
  458.          var fieldWidth = 0;
  459.          if (this.fieldCount > 0) fieldWidth = this.tableWidth/this.fieldCount;
  460.          if (fieldWidth > 0) 
  461.             write("\n<TD WIDTH = "+fieldWidth+" >");
  462.          else 
  463.             write("\n<TD>");
  464.  
  465.       write("<FONT COLOR=" + this.dataTextColor + " SIZE=\""+this.dataSize+((this.dataFont != null) ? "\" FACE=\"" + this.dataFont+"\"":"") + ">");
  466.       if (this.dataUnderline) write("<U>");
  467.       if (this.dataBold) write("<B>");
  468.       if (this.dataItalic) write("<I>");
  469.       
  470.       // Begin constructing URL string.  Set "listActive" parameter equal to "true" for listening Query objects
  471.       // that are set to use the previous query from this list
  472.       if (this.fieldNames[i].toUpperCase() == this.hyperlinkField.toUpperCase() && !this.hyperlinkError) {
  473.          LinkStr = this.hyperlinkPage + "?" + pre + "listActive=true";     
  474.       
  475.       // Add key fields, values and types to URL string   
  476.       if (this.keyFieldCount > 0) 
  477.          LinkStr += "&";
  478.       
  479.          // Build up URL-encoded string of key fields, labels and their data types
  480.          for (var kcnt = 0; kcnt < this.keyFieldCount; kcnt++) {
  481.  
  482.             LinkStr += fieldPre + this.keyFieldLabels[kcnt] + "=" + 
  483.                escape(formatDataValue(this.theCursor.fields(this.keyFieldNames[kcnt]), this.keyFieldDataTypes[kcnt]));
  484.             LinkStr += "&" + pre + this.keyFieldLabels[kcnt] + "_dataType" + "=" + this.keyFieldDataTypes[kcnt];
  485.             if (kcnt < this.keyFieldCount-1) LinkStr += "&";
  486.          } // end for
  487.                  
  488.            write("<A href= \""+LinkStr+"\">");
  489.  
  490.       }   // end if
  491.  
  492.       if (this.theCursor.fields(this.fieldNames[i]) != null) {           
  493.          write(this.theCursor.fields(this.fieldNames[i]));
  494.       }
  495.       else {
  496.          write("");      
  497.       } // end if
  498.      
  499.       if (this.fieldNames[i].toUpperCase() == this.hyperlinkField.toUpperCase() & !this.hyperlinkError)  write("</A>");
  500.       if (this.dataItalic) write("</I>");
  501.       if (this.dataBold) write("</B>");
  502.       if (this.dataUnderline) write("</U>");
  503.       write("</FONT>");
  504.       write("</TD>");
  505.    }  //end for
  506.  
  507. }  // END liEmitTableRow
  508.  
  509.  
  510. //
  511. // Writes out HTML that displays all rows in list
  512. //
  513. function liEmitTableBody () {
  514.  
  515.     var count = 0;
  516.     var limit = 0;
  517.    //debug("Writing table body...");   
  518.    write("<TBODY>");
  519.  
  520.       //debug("Getting cursor from query '" + this.queryComponent + "'");
  521.       this.theCursor= eval(this.queryComponent + ".getCurrentCursor()");
  522.       //this.createDebugCursor()
  523.  
  524.       if (this.theCursor != null) {
  525.           if (eval(this.queryComponent + ".initializeCursor()")) {
  526.  
  527.               write(this.checkFieldErrors());            
  528.             
  529.             // Loop through the 2nd through nth rows where there are n rows in the 
  530.             // data set.  
  531.  
  532.             // check to see if we have a DBNav component specified
  533.             if ((this.navComponent != null) && (this.navComponent != "")) 
  534.                 limit = eval(this.navComponent + ".getNumRecords()");
  535.             
  536.                 // If a limit was specified, only show that many records
  537.                 if (limit != 0)
  538.                     while( !eval(this.queryComponent + ".isCursorEnd()") && (count < limit)) {
  539.                     write("\n<TR>");
  540.                    this.emitTableRow();
  541.                    write("</TR>");
  542.                    count++;
  543.                    eval(this.queryComponent + ".moveNext(1)");
  544.                }
  545.             else    // otherwise, show all records in the recordset
  546.                     while(!eval(this.queryComponent + ".isCursorEnd()")) {
  547.                        write("\n<TR>");
  548.                    this.emitTableRow();
  549.                    write("</TR>");
  550.                    count++;
  551.                    eval(this.queryComponent + ".moveNext(1)");
  552.                }
  553.                 
  554.                 // rewind the cursor
  555.             eval(this.queryComponent + ".movePrevious(" + count + ")");
  556.             eval(this.queryComponent + ".closeCursor()");
  557.           }
  558.           else {
  559.                 write("\n<TR><TD COLSPAN=" + this.fieldCount + ">No records found.");            
  560.                   eval(this.queryComponent + ".closeCursor()");
  561.           }
  562.         }
  563.         else {  
  564.         write("\n<TR><TD COLSPAN=" + this.fieldCount + ">Unable to obtain a valid cursor.");            
  565.         }
  566.  
  567.    write("\n</TBODY>");
  568.    
  569. }  // END liEmitTableBody
  570.  
  571.  
  572. //
  573. // Writes out HTML that displays list footer
  574. //
  575. function liEmitTableFooter () {
  576.    //debug("Writing table footer...");   
  577.    write("</TABLE>");
  578. }  // END liEmitTableFooter
  579.  
  580. </SCRIPT>