The WddxRecordset object includes functions that you call as needed when constructing a WDDX recordset.
Adds the specified column to all rows in the WddxRecordset instance.
object.addColumn( name )
Instance name of the WddxRecordset object.
Name of the column to add.
None.
This function adds the specified column to every row of the WDDX record set. Initially the new column's values are set to NULL.
This example calls the addColumn function:
// create a new recordset rs = new WddxRecordset(); // add a new column rs.addColumn("NewColumn"); // extend the recordset by 3 rows rs.addRows(3); // set an element in the first row // newValue is a previously defined variable rs.setField(0, "NewColumn", newValue);
Adds the specified number of rows to all columns in the WddxRecordset instance.
object.addRows( n )
Instance name of the WddxRecordset object.
Integer specifying the number of rows to add.
None.
This function adds the specified number of rows to every column of the WDDX record set. Initially, the row/column values are set to NULL.
This example calls the addRows function:
// create a new recordset rs = new WddxRecordset(); // add a new column rs.addColumn("NewColumn"); // extend the recordset by 3 rows rs.addRows(3); // set an element in the first row // newValue is a previously defined variable rs.setField(0, "NewColumn", newValue);
Returns the element in the specified row/column position.
object.getField( row, col )
Instance name of the WddxRecordset object.
Integer specifying the zero-based row number of the value to be returned.
Integer or string specifying the column of the value to be returned.
Returns the value in the specified row/column position.
Call this function to access a value in a WDDX record set.
This example calls the getField function (the variable r is a reference to a WddxRecordset instance):
for (row = 0; row < nRows; ++row) { o += "<tr>"; for (i = 0; i < colNames.length; ++i) { o += "<td>" + r.getField(row, colNames[i]) + "</td>"; } o += "</tr>"; }
Indicates the number of rows in the WddxRecordset instance.
object.getRowCount( )
Instance name of the WddxRecordset object.
Integer. Returns the number of rows in the WddxRecordset instance.
Call this function before a looping construct to determine the number of rows in the record set.
This example calls the getRowCount function:
function dumpWddxRecordset(r) { // Get row count nRows = r.getRowCount(); ... for (row = 0; row < nRows; ++row) ...
Sets the element in the specified row/column position.
object.setField( row, col, value )
Instance name of the WddxRecordset object.
Integer specifying the row containing the element to be set.
Integer or string specifying the column containing the element to be set.
Value to be set.
None.
Call this function to set a value in a WddxRecordset instance.
This example calls the setField function:
// create a new recordset rs = new WddxRecordset(); // add a new column rs.addColumn("NewColumn"); // extend the recordset by 3 rows rs.addRows(3); // set an element in the first row // newValue is a previously defined variable rs.setField(0, "NewColumn", newValue);
Serializes a record set.
object.wddxSerialize( serializer )
Instance name of the WddxRecordset object.
WddxSerializer instance.
Boolean. Returns True if serialization was successful and False if an error occurs.
Internal. You do not typically call this function.
This example is from the WddxSerializer serializeValue function:
... else if (typeof(obj) == "object") { if (obj == null) { // Null values become empty strings this.write("<string></string>"); } else if (typeof(obj.wddxSerialize) == "function") { // Object knows how to serialize itself bSuccess = obj.wddxSerialize(this); } ...