| Previous | Next | Frames | No Frames |
| Summary: Field | Property | Contructor | Method | Detail: Field | Property | Contructor | Method |
Object
|
+--xp.system.DispatcherObject
|
+--xp.data.ItemDataSource
|
+--xp.data.DataSource
Field Summary | ||
| public | autoCommit: Boolean | |
| Control whether changes are automatically commited when validated. | ||
| public | autoEdit: Boolean | |
| Control whether the datasource can automatically enter edit mode | ||
| public | autoInsert: Boolean | |
| Control whether the datasource can automatically enter insert mode | ||
| public | calcFields: Object | |
| The names of the calculated fields. | ||
| public static | classInfo: Object | |
| A static class information object | ||
| public | deltaPacket: Object | |
| Returns changes made to the collection, or assigns changes to be made to the collection | ||
| public | itemClassName: Function | |
| The class for new data items | ||
| public | logChanges: Boolean | |
| Indicates whether changes made to the collection, or its items, are recorded. | ||
| public | newDataItem: Object | |
| A new data item | ||
| public | nodeName: String | |
| The node name for new xml data items | ||
| public | usesManualCommit: Boolean | |
| Control whether this source uses manual commits for row changes | ||
| ||
| ||
Property Summary | ||
| public | currentItem: Object (read-only) | |
| Get the current data item encapsulated by this datasource | ||
| public | isEditing: Boolean (read-only) | |
| Is the current record being edited | ||
| public | isInserting: Boolean (read-only) | |
| Is the current record being insertd | ||
| public | isValid: Boolean (read-only) | |
| Is the current row valid | ||
| public | schema: Object (read, write) | |
| Get or set the schema. | ||
| ||
Constructor | ||
| public | DataSource ( dataItem: Object) | |
| Create a new DataSource instance | ||
Method Summary | ||
| public | applyChanges ( ): Boolean | |
| Save or commit current item edits | ||
| public | applyUpdates ( ): Void | |
| Signals that the deltaPacket property has a value that you can access using data binding or ActionScript | ||
| public | cancelChanges ( ): Boolean | |
| Rollback changes to the current item | ||
| public | checkSchema ( force: Boolean ): Void | |
| Check whether the schema has been created | ||
| public | commitChanges ( ): Void | |
| Commit's changes for the current transaction | ||
| public | createItem ( ): Object | |
| create a new item | ||
| public | deleteItem ( ): Boolean | |
| Deletes the current item | ||
| public | editItem ( ): Boolean | |
| Switch to edit mode | ||
| public | getClass ( ): Function | |
| Returns a reference to the components static class | ||
| public | insertItem ( ): Boolean | |
| Switch to insert mode | ||
| public | rollbackChanges ( ): Void | |
| Rollsback changes for the current transaction | ||
| public | toString ( ): String | |
| the info | ||
| public | validate ( ): Boolean | |
| Validates the current record | ||
| ||
| ||
| public var autoCommit: Boolean |
| Control whether changes are automatically commited when validated. If false a row may be validated but remain dirty. |
| public var autoEdit: Boolean |
| Control whether the datasource can automatically enter edit mode If true then any attempt to edit data in a field will place the datasource in edit mode |
| public var autoInsert: Boolean |
| Control whether the datasource can automatically enter insert mode If true then any attempt to edit data in a field when there is not currentItem will place the datasource in insert mode |
| public var calcFields: Object |
| The names of the calculated fields. A space separated list of calculated fields. This property only needs to be set if you have calculated fields AND you have not explicilty set the schema. Calculated fields will still function even if this property is not set, however whilst editing or inserting calculated fields may not update until the record is committed. If a schema has been set then this property is ignored |
| public static var classInfo: Object |
| A static class information object Every class has an associated classInfo object that holds the version and other static information. The classInfo can be accessed either directly by referencing the static class or by calling getClass() on any class instance. |
| public var deltaPacket: Object |
| Returns changes made to the collection, or assigns changes to be made to the collection Property; returns a delta packet that contains all of the change operations made to the dataSource collection and its items. This property is null until DataSource.applyUpdates() is called on dataSource. When DataSet.applyUpdates() is called, a transaction ID is assigned to the delta packet. This transaction ID is used to identify the delta packet on an update round trip from the server and back to the client. Any subsequent assignment to the deltaPacket property by a delta packet with a matching transaction ID is assumed to be the server’s response to the changes previously sent. A delta packet with a matching ID is used to update the collection and report errors specified within the packet. |
| public var itemClassName: Function |
| The class for new data items This is used to generate a new object when createItem is called |
| public var logChanges: Boolean |
| Indicates whether changes made to the collection, or its items, are recorded. A Boolean value that specifies whether changes made to the data source, or its items, should (true) or should not (false) be recorded in DataSource.deltaPacket. When this property is set to true, operations performed at the collection level and item level are logged. Collection-level changes include the addition and removal of items from the collection. Item-level changes include property changes made to items and method calls made on items by means of the DataSource component. |
| public var newDataItem: Object |
| A new data item This is used as a template when createItem is called |
| public var nodeName: String |
| The node name for new xml data items This is used to generate a new XMLNode when createItem is called |
| public var usesManualCommit: Boolean |
| Control whether this source uses manual commits for row changes |
|
| Get the current data item encapsulated by this datasource |
|
|
| Is the current record being edited |
|
| Is the current record being insertd |
|
| Is the current row valid |
|
| Get or set the schema. Schema is optional and only used when logging changes. |
|
| Create a new DataSource instance |
|
| Save or commit current item edits |
|
|
| Signals that the deltaPacket property has a value that you can access using data binding or ActionScript Signals that the DataSource.deltaPacket property has a value that you can access using data binding or directly by ActionScript. Before this method is called, the DataSource.deltaPacket property is null. This method has no effect if events have been disabled by means of the DataSource.disableEvents property Calling this method also creates a transaction ID for the current DataSource.deltaPacket property and emits a deltaPacketChanged event. For more information, see DataSource.deltaPacket |
|
| Rollback changes to the current item This method can be called during editing or inserting to cancel any current changes and rollback to the previous version. |
|
|
| Check whether the schema has been created If logChanges is true and no schema exists a default schema will be generated. This will also result in the dataItem object being built. | |||
|
|
| Commit's changes for the current transaction |
|
| create a new item Creates a new data item but does not insert it or add it to the collection. The newItem event will be fired allowing the user to modify the data itme before it is returned This is called internally when insertItem is called to place the DataSource in insert mode The property newDataItem is used as the template for the empty data item. |
|
|
| Deletes the current item |
|
|
| Switch to edit mode |
|
|
| Returns a reference to the components static class |
|
|
| Switch to insert mode |
|
|
| Rollsback changes for the current transaction |
|
| the info |
|
| Validates the current record Check whether the current record is valid or not. If autoCommit is true it implicitly calls applyChanges if the current record is not valid |
|
DataSource adds the capabilty to update, insert and delete the current item, track the changes to the currrentItem through a DeltaPacket that can be used to update the server. SubClasses like ListDataSource lets you work with data as collections of objects.
A DataSource can be bound to the currentItem of another DataSource or a ListDataSource to create simple master/detail relationships.
A DataSource is somewhat similar to a DataHolder.
Event summary for the ListDataSource class
The following table lists events of the ListDataSource class.