About working with RecordSet objects
77
Getting information about a RecordSet object
To get information about a RecordSet object, use the following methods:
In the following example,
theRecordSet
represents a RecordSet object:
// Get an array of the column names and convert it to a comma delimited list
columns = theRecordSet.columnNames.join();
// The total number of records in the RecordSet
recordcount = theRecordSet.length;
// The number of records that are currently available to the Flash client
recordsavail = theRecordSet.getNumberAvailable();
// Have all the records been returned? (Only true if recordcount ==
// recordsavail)
allthere = theRecordSet.isFullyPopulated();
Changing record set data
After you download all records into the RecordSet object or create a new
RecordSet
object in
ActionScript, you can use the
RecordSet
ActionScript class data-editing methods to insert,
update, and remove records. Changes to the RecordSet object in the Flash application are not
propagated back to the application server. To insert, update, or remove records in a database, you
must call application server methods or pages using service functions.
Method
Description
RecordSet.contains()
Indicates whether the record set contains the specified record.
RecordSet.getColumnNames()
Returns an array of the names of the columns of a RecordSet
object.
RecordSet.getItemID()
Returns the record ID used internally by Flash Remoting to
identify the record.
RecordSet.getIterator()
Returns a new iterator for the record set. For more information
see Collections in Flash.
RecordSet.getLength()
Deprecated. Returns the number of records in a RecordSet
object.
RecordSet.getLocalLength()
Returns the number of records downloaded, or currently
available locally. In
fetchAll
mode this value is equal to the
length of the remote record set.
RecordSet.getNumberAvailable()
Returns the number of records that have been downloaded
from the server.
RecordSet.getRemoteLength()
Returns the number of records in the RecordSet on the server.
RecordSet.isEmpty()
Determines whether a
RecordSet
object is empty.
RecordSet.isFullyPopulated()
RecordSet.isLocal()
Returns true if the RecordSet object was created locally using
the New operator or if the record set was returned by a Flash
Remoting service function and all the data in the record set has
been returned from the server.
A RecordSet object must be fully populated before you can
change its contents or use the
RecordSet
.
filter()
method.
These two methods are currently equivalent.