DataSet.readOnly

Availability

Flash Player 7.

Edition

Flash MX Professional 2004.

Usage

dataSetInstance.readOnly

Description

Property; a Boolean value that specifies whether this collection can be modified (false) or is read-only (true). Setting this property to true prevents updates to the collection. The default value is false.

You can also set this property in the Property inspector.

Example

The following example makes the DataSet object named my_ds read-only, and then attempts to change the value of a property that belongs to the current item in the collection. This attempt throws a DataSetError exception.

import mx.data.components.datasetclasses.DataSetError;
my_ds.readOnly = true;
try {
    // This throws an exception.
    my_ds.addItem({name:'Joe'});
} catch (e:DataSetError) {
    // Sort specified 'name' doesn't exist for DataSet 'my_ds'.
    trace("DataSetError >> " + e.message);
}

See also

DataSet.currentItem


Flash CS3