(Adobe® Flex™ Data Services 2 only)
Packagemx.data
Classpublic class DataService
InheritanceDataService Inheritance Object
ImplementsIEventDispatcher
SubclassesDataService

The DataService class provides the top-level functionality for Data Management Services in Flex 2. The DataService provides synchronization, replication, and occasionally connected services.

A DataService is constructed specifying the desired destination. These destinations are configured from the services-config.xml file.

There are two different sets of methods that retreive data from the specified remote destination. The first are for collection managed objects. The second are for Single Managed Objects or SMO.

For the collection managed objects the DataService.fill() method is used. This method populates an ArrayCollection with objects that this services will manage.

To get Single Managed Objects the DataService.getItem() and DataService.createItem() methods are used.

When a previously filled ArrayCollection is no longer needed, or the items within that collection should no longer receive or create updates, the DataService.releaseCollection() method is called.

When an item previously retreived using DataService.getItem() or DataService.createItem() is no longer needed or should not receive or create updates, the DataService.releaseItem() method is be called. The DataService.createItem() and DataService.getItem() methods return an ItemReference. This object can be used to release a specific instance of a single managed object. Unlike the DataService.releaseItem() method, calling ItemReference.releaseItem() will release a specific instance of an SMO. DataService.releaseItem() will release the first SMO that it finds with a matching identity to that specified. This is normally okay as long as the number of calls to DataService.getItem() and DataService.createItem() matches the number of calls to DataService.releaseItem().

A connection to the remote destination is created automatically the first time any methods that require a connection are called. For example, calling the DataService.fill() method or DataService.commit() operation when there are uncommited updates will attempt to establish a connection to the remote destination. To force a DataService to become disconnected use the DataService.disconnect() method. This method can be used to clean up remote destination resources when no longer needed. Because other services may be using the same physical connection calling DataService.disconnect() may terminate the connection.

The bindable property connected indicates the current state of the associated DataService connection.

If a remote destination has declared any security constraints for an operation, credentials must be provided. Credentials are set via the DataService.setCredentials() call. This turns into a login command at the remote destination. To change credentials or invalidate the current session DataService.logout() can be called. When called the DataService.logout() method will release all local managed data. It is equivalent to calling DataService.release().

Each DataService has a dataStore property that returns an object of type mx.data.DataStore. This object stores the uncommitted changes for one or more DataService objects. By default, a DataServiceshares the same DataService with other data services if they have managed association properties and share the same set of channels. When sharing DataStores, a commit() method call on one DataService commits changes for all DataService using the shared data store. This preserves the order of operations in the event there are dependencies between the changes in the associated DataService objects.

DataService and DataService dispatch result and fault events for all operations that require a remote call.

Data binding can be used on properties of any managed instances for a DataService. DataService will also dispatch a "message" event when a remote operation occurs for any managed object. For example when a locally managed item is updated by a remote process a message will be pushed to all DataService instances that are still managing that item. This message is dispatched as a MessageEvent.MESSAGE event.

When a conflict is detected either at the remote destination in response to a change committed by the DataService, or due to a pushed change which conflicts with a local uncommitted change, a conflict event is dispatched. These events can be handled by listening for the DataConflictEvent.CONFLICT. Data binding can be employed to update UI controls by binding to the DataService.conflicts.resolved property.

DataService supports the following data synchronization configuration modes:

The DataService.revertChanges() method is used to revert changes for a specific item or for all items. When an error occurs for a remote destination operation, the committed changes are put back into the uncommitted queue so the data stays in sync with the remote destination data. If the changes are in error, typically a call to DataService.revertChanges() is made to undo the changes as part of a fault handler.

The mx.data.mxml.DataService class is an MXML-specific subclass of mx.data.DataService that allows binding to the properties of a DataService.

MXML Syntaxexpanded Hide MXML Syntax

The <mx:DataService> tag accepts the following tag attributes:

  <mx:DataService
   Properties
   autoCommit="true"
   autoSyncEnabled="true"
   autoMerge="true"
   conflictDetector="No default."
   dataStore="No default."
   destination="No default."
   pageSize="No default."
   id="No default."
 
   Events
   conflict="No default."
   fault="No default."
   message="No default."
   propertyChange="No default."
   result="No default."
 />
 

See also

mx.data.mxml.DataService
mx.data.Conflicts
mx.data.Conflict
mx.data.ItemReference
mx.data.IManaged
mx.data.utils.Managed
mx.data.IChangeObject
Creating a distributed data application


Public Properties
 PropertyDefined by
  autoCommit : Boolean
Indicates if changes to the buffer are automatically committed.
DataService
  autoMerge : Boolean
If set to false, when changes are pushed from the remote destination to the client they are not immediately applied.
DataService
  autoSyncEnabled : Boolean
When true, fill(), createItem() and getItem() requests return items which listen for updates made to these items from the remote destination.
DataService
  commitRequired : Boolean
[read-only] Indicates if there are changes that have not been committed and the commit() method should be called.
DataService
  conflictDetector : ConflictDetector
Provides access to the current implementation being used to detect conflicts for remote operations pushed to this DataService.
DataService
  conflicts : Conflicts
[read-only] Returns the Conflicts object, an ArrayList of Conflict instances.
DataService
  connected : Boolean
[read-only] Indicates if the DataService is connected to the remote destination.
DataService
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  dataStore : DataStore
Returns an object of type mx.data.DataStore.
DataService
  destination : String
[read-only] Indicates which remote destination this service is associated with.
DataService
  mergeRequired : Boolean
[read-only] Indicates if there are any pending changes that must be merged.
DataService
  pageSize : int
Provides access to the current page size setting for all collections.
DataService
  pagingEnabled : Boolean
[read-only] Indicates if the remote desintation is configured to allow paged requests.
DataService
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  requestTimeout : int
Provides access to the request timeout in seconds for an operation.
DataService
Public Methods
 MethodDefined by
  
DataService(destination:String)
Constructs an instance of the DataService with the specified destination.
DataService
  
Commits any pending changes for all collections currently managed by this service.
DataService
  
Calls a count method on the remote destination.
DataService
  
Requests that the specified item be created in the remote store.
DataService
  
Requests that the specified item be deleted from the remote store.
DataService
  
Disconnects the DataService's network connection.
DataService
  
Fills the specified ListCollectionView based on the associated <fill-method> elements.
DataService
  
getItem(identity:Object, defaultValue:Object = null):ItemReference
Makes an asynchronous request for an item matching the specified identity.
DataService
  
Returns the pending operation in the message cache for the specified item.
DataService
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
  
Logs the user out of the destination for the DataService.
DataService
  
Merges any pending updates into the managed set of objects.
DataService
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
Releases all managed collections and items for the DataService.
DataService
  
Releases any item within the specified collection from management by this service.
DataService
  
releaseItem(item:IManaged, allowCopy:Boolean = true):IManaged
Releases the specified item from management by this service.
DataService
  
Reverts any uncommitted changes to the specified item.
DataService
  
setCredentials(username:String, password:String):void
Sets the credentials for this DataService destination.
DataService
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
setRemoteCredentials(username:String, password:String):void
Sets the credentials for the third party of this DataService destination.
DataService
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Events
 EventSummaryDefined by
   The DataConflictEvent.CONFLICT event is dispatched when a conflict is detected between either pending local changes and changes submitted by another client, or when changes submitted by this client are conflicting with those in the remote destination.DataService
   The DataServiceFaultEvent.FAULT event is dispatched when a service call fails due to an error.DataService
   The MessageEvent.MESSAGE event is dispatched when the remote destination pushes a notification of a data operation.DataService
   The PropertyChangeEvent.PROPERTY_CHANGE event is dispatched when a property of this service changes.DataService
   The ResultEvent.RESULT event is dispatched when a service call successfully returns.DataService
Property detail
autoCommitproperty
autoCommit:Boolean  [read-write]

Indicates if changes to the buffer are automatically committed. Committed changes are sent to the remote service immediately.

Implementation
    public function get autoCommit():Boolean
    public function set autoCommit(value:Boolean):void
autoMergeproperty 
autoMerge:Boolean  [read-write]

If set to false, when changes are pushed from the remote destination to the client they are not immediately applied. Instead, the mergeRequired property is set to true. An event handler can be registered to listen for change events on this property to be notified of when a merge needs to be applied. To merge changes, call the merge() method and all changes are applied. Uncommited changes can not be committed when there are any changes that need to be merged. If paging is enabled all requests for non local items are cached until merge() is called. Once merge() is called, the cached requests are processed.

Implementation
    public function get autoMerge():Boolean
    public function set autoMerge(value:Boolean):void
autoSyncEnabledproperty 
autoSyncEnabled:Boolean  [read-write]

When true, fill(), createItem() and getItem() requests return items which listen for updates made to these items from the remote destination. When a change is made to this property value, it only affects future calls to these methods, not existing collections or items. Also note that when a mix of collections retrieved with autoSyncEnabled and those that were filled without autoSyncEnabled, any items appearing in both collections will still receive update events.

Implementation
    public function get autoSyncEnabled():Boolean
    public function set autoSyncEnabled(value:Boolean):void
commitRequiredproperty 
commitRequired:Boolean  [read-only]

Indicates if there are changes that have not been committed and the commit() method should be called. When this property changes, an event is dispatched. This property can be used within an application to provide visual feedback.

This property can be used as the source for data binding.

Implementation
    public function get commitRequired():Boolean
conflictDetectorproperty 
conflictDetector:ConflictDetector  [read-write]

Provides access to the current implementation being used to detect conflicts for remote operations pushed to this DataService.

Implementation
    public function get conflictDetector():ConflictDetector
    public function set conflictDetector(value:ConflictDetector):void
conflictsproperty 
conflicts:Conflicts  [read-only]

Returns the Conflicts object, an ArrayList of Conflict instances. Conflicts must be resolved before commit() can be called. Conflicts can be resolved by going through the conflicts, resolving each conflict individually or by calling the acceptAllClient() method or acceptAllServer() method on this property.

Implementation
    public function get conflicts():Conflicts
connectedproperty 
connected:Boolean  [read-only]

Indicates if the DataService is connected to the remote destination.

This property can be used as the source for data binding.

Implementation
    public function get connected():Boolean
dataStoreproperty 
dataStore:DataStore  [read-write]

Returns an object of type mx.data.DataStore. The DataStore manages the set of incoming and outgoing changes for one or more DataServices, which may have references between them. When you commit on a DataStore, all of the pending changes of each DataService using that DataStore are committed. By default, a DataService shares the same DataStore with other DataServices if they have managed association properties and share the same set of channels. If you are sharing DataStores, a commit call on one DataService commits changes for all DataServices using that data store. This preserves the order of operations in case there are dependencies between the changes in your uncommitted batches.

This property can be used as the source for data binding.

Implementation
    public function get dataStore():DataStore
    public function set dataStore(value:DataStore):void
destinationproperty 
destination:String  [read-only]

Indicates which remote destination this service is associated with.

Implementation
    public function get destination():String
mergeRequiredproperty 
mergeRequired:Boolean  [read-only]

Indicates if there are any pending changes that must be merged.

This property can be used as the source for data binding.

Implementation
    public function get mergeRequired():Boolean
pageSizeproperty 
pageSize:int  [read-write]

Provides access to the current page size setting for all collections.

Implementation
    public function get pageSize():int
    public function set pageSize(value:int):void
pagingEnabledproperty 
pagingEnabled:Boolean  [read-only]

Indicates if the remote desintation is configured to allow paged requests.

Implementation
    public function get pagingEnabled():Boolean
requestTimeoutproperty 
requestTimeout:int  [read-write]

Provides access to the request timeout in seconds for an operation. A value less than or equal to zero prevents request timeout. When a current operation times out due to the requestTimeout limit being reached a fault will be dispatched for that operation, indicating that the request was timed out.

Implementation
    public function get requestTimeout():int
    public function set requestTimeout(value:int):void
Constructor detail
DataService()constructor
public function DataService(destination:String)

Constructs an instance of the DataService with the specified destination. The destination must be a reference to a destination configured in the services-config.xml file.

Parameters
destination:String — that contains the name of the desired destination.
Method detail
commit()method
public function commit():AsyncToken

Commits any pending changes for all collections currently managed by this service. When autoCommit property is true, transactions are not be used. To use transactions, set the autoCommit property to false and call this method directly.

Returns
AsyncToken — AsyncToken that will be returned in the call property of either the ResultEvent.RESULT or in the FaultEvent.FAULT. Custom data can be attached to this object and inspected later during the event handling phase.
count()method 
public function count(... args):AsyncToken

Calls a count method on the remote destination. The count method called is based on the associated <count-method> tags and the parameters passed. For example, if the following count("firstName", "Bob") call was made and <count-method> tags exist or are referenced in the services-config.xml under the associated destination:


            <count-method>
                <name>getCount</name>
                <params>java.lang.String,java.lang.String</params>
                <security-run-as name="freddie" password="nightmare" />
            </count-method>
            
            <count-method>
                <name>getCount</name>
                <security-constraint ref="sample-users" />
            </count-method>
      
The first <count-method> with the run-as security setting is invoked because it contains two parameters, which matches the <params> tag types and count.

Parameters
... args — List of arguments that should be passed to the remote destination.

Returns
AsyncToken — Object returned in the call property of the ResultEvent.RESULT or in the FaultEvent.FAULT. Custom data can be attached to this object and inspected later during the event handling phase.

See also

createItem()method 
public function createItem(item:Object):ItemReference

Requests that the specified item be created in the remote store. If an error occurs a DataConflictEvent is dispatched.

Parameters
item:Object — that should be created in the remote store.

Returns
ItemReference — ItemReference (which extends AsyncToken). This reference is returned in the token property of either the ResultEvent.RESULT or in the FaultEvent.FAULT. Custom data can be attached to this object and inspected later during the event handling phase. The result property of this object is bindable and can be used to bind the item returned. This result object is set to null if the item is removed from another client. If you hold on to ItemReference objects in your application, you should call the releaseItem() method in the ItemReference when you are finished with this reference to the item. If you do not hold onto the ItemReferences, you can use the releaseItem() method on the DataService, which takes the instance of the item itself to release.
deleteItem()method 
public function deleteItem(item:Object):AsyncToken

Requests that the specified item be deleted from the remote store. If an error occurs a DataConflictEvent will be dispatched.

Parameters
item:Object — that should be deleted in the remote store.

Returns
AsyncToken — AsyncToken that will be returned in the token property of either the ResultEvent.RESULT or in the FaultEvent.FAULT. Custom data can be attached to this object and inspected later during the event handling phase.
disconnect()method 
public function disconnect():void

Disconnects the DataService's network connection. This method does not wait for outstanding network operations to complete.

fill()method 
public function fill(value:ListCollectionView, ... args):AsyncToken

Fills the specified ListCollectionView based on the associated <fill-method> elements. For example, if the following <fill-method> elements exist or are referenced in the services-config.xml under the associated destination:

            <fill-method>
                <name>loadPersons</name>
                <params>java.lang.String,java.lang.String</params>
                <security-run-as name="freddie" password="nightmare" />
            </fill-method>
            
            <fill-method>
                <name>loadPersons</name>
                <security-constraint ref="sample-users" />
            </fill-method>
      
Then calling fill(myCollection, ["firstName", "Bob"]) invokes the first <fill-method> with the run-as security setting since it contains two parameters, matching the <params> tag types and count. Likewise, calling fill(myCollection) invokes the second <fill-method> tag as it contains no <params> tag. Any pending changes or data is cleared during a call to fill.

Parameters
value:ListCollectionView — to the collection that should be filled with the specified arguments.
 
... args — rest:Array variable list of arguments that should be passed to the remote destination.

Returns
AsyncToken — Object that is returned in the call property of the ResultEvent.RESULT or in the FaultEvent.FAULT. Custom data can be attached to this object and inspected later during the event handling phase.
getItem()method 
public function getItem(identity:Object, defaultValue:Object = null):ItemReference

Makes an asynchronous request for an item matching the specified identity. If you provide a defaultValue, and the item does not exist, the item is created instead using the information in the defaultValue. This method returns an ItemReference. If you receive a valid instance from the getItem() method call, you must call the releaseItem() method to release an instance of the item. If you hang onto the ItemReference, you should call the releaseItem() method on the reference to be sure you release the proper reference (in case your client has made more than one getItem() method call for the same item). If you do not hold onto the ItemReference, you can call the releaseItem() method on the DataService with the item itself.

Parameters
identity:Object — Object that contains the identity properties for the desired object.
 
defaultValue:Object (default = null) — An instance of the type with the default values that should be created if it doesn't exist.

Returns
ItemReference — ItemReference to the item you want to get. The ItemReference extends AsyncToken so you can use it to receive notification of when the item has been retrieved or when this call produces a fault. The ItemReference is returned as the token property in either the ResultEvent.RESULT or in the FaultEvent.FAULT if you are listening for events on the DataService object. Custom data can be attached to this object and inspected later during the event handling phase. You also can use data binding to bind to the result property of the ItemReference. This property is set to a valid value when the item is populated from the remote destination and is bindable so you can simply bind your user interface controls to the properties of the ItemReference's result property. If the item is removed from the server or another client, this reference is set to null. The ItemReference also has an invalid property which is set to true if the are errors returning the item or if the server returns null for an item.
getPendingOperation()method 
public function getPendingOperation(item:IManaged):uint

Returns the pending operation in the message cache for the specified item. Use this method to provide visual feedback to a user of what type of change, if any, has been made to an item.

Parameters
item:IManaged — that should be tested against.

Returns
uint — uint that indicates what pending operation has been performed. The following are valid operations for an item:
  • DataMessage.CREATE_OPERATION - indicates that a create is pending for the specified item.
  • DataMessage.DELETE_OPERATION - indicates that a delete is pending for the specified item.
  • DataMessage.UPDATE_OPERATION - indicates that updates are pending for the specified item.
  • DataMessage.UNKNOWN_OPERATION - indicates that no operations are pending for the specified item.
logout()method 
public function logout():void

Logs the user out of the destination for the DataService. Logging out of a destination applies to everything connected using the same ChannelSet as specified in the server configuration. For example, if you are connected over the my-rtmp channel and you log out using one of your DataService instances, anything that was connected over the same ChannelSet is logged out.

merge()method 
public function merge():void

Merges any pending updates into the managed set of objects. The process of merging changes detect conflicts and process any pending item requests. This merges all messages for any other DataService instances that share this same data store.

release()method 
public function release():void

Releases all managed collections and items for the DataService.

See also

releaseCollection()method 
public function releaseCollection(view:ListCollectionView, clear:Boolean = false):void

Releases any item within the specified collection from management by this service. If the item exists in more than one collection, a copy of the item is made. Any uncommitted changes made to an item that exists only in this collection are released, including deletes, creates and updates.

Parameters
view:ListCollectionView — ListCollectionView reference that should no longer receive remote updates.
 
clear:Boolean (default = false) — Boolean indicating if the all items should be removed from the list. In addition no copies will be made of any item.
releaseItem()method 
public function releaseItem(item:IManaged, allowCopy:Boolean = true):IManaged

Releases the specified item from management by this service. If you hold onto ItemReferences, you should call the releaseItem() method on the ItemReference to be sure you release the proper reference in the case where you might have made more than one getItem call which retrieves the same item from different parts of your client application.

This call releases any associated resources, including nested properties. The specified item no longer receives updates from the remote destination. In addition if there are any uncommited changes to this item and it does not appear in any other collection these changes will also be released. If the specified item exists in more than one collection then the value handed back will be a copy of the original unless the allowCopy parameter is set to false.

Parameters
item:IManaged — IManaged reference to the item to be released.
 
allowCopy:Boolean (default = true) — Optional parameter that defaults to true. If true, makes a copy of the item if it is still referenced by another managed reference. You can set this to false but it would mean that object might still get updates from the server if it is still managed through other references.

Returns
IManaged — the released item which will be a copy if allowCopy=false and the item is managed by another reference.
revertChanges()method 
public function revertChanges(item:IManaged = null):Boolean

Reverts any uncommitted changes to the specified item. Or if no item is suppied, it will revert all uncommitted changes. If you revert a create operation, it removes the item. If you revert a delete, it adds the item back in. Reverting an update restores the original properties of the item that were in place before you started changing it.

One situation in which you would use this method is after a fault has occurred. In that case, any failed changes are put back into the uncommitted changes list. At that point you can either modify those changes to fix the problem or revert them using this method to keep those changes from being resubmitted again.

If an item is supplied and this item doesn't have any changes this method will return false. If no item is supplied and there are no changes this method returns false. Otherwise, it returns true.

Parameters
item:IManaged (default = null) — reference to revert changes for or null to revert all changes.

Returns
Boolean — Boolean indicating if any changes were reverted.
setCredentials()method 
public function setCredentials(username:String, password:String):void

Sets the credentials for this DataService destination. The credentials are applied to all services connected over the same ChannelSet.

Parameters
username:String — username for the destination.
 
password:String — The password for the destination
setRemoteCredentials()method 
public function setRemoteCredentials(username:String, password:String):void

Sets the credentials for the third party of this DataService destination.

Parameters
username:String — The username for the destination.
 
password:String — The password for the destination.
Event detail
conflictevent 
Event object type: mx.data.events.DataConflictEvent
DataConflictEvent.type property = mx.data.events.DataConflictEvent.CONFLICT

The DataConflictEvent.CONFLICT event is dispatched when a conflict is detected between either pending local changes and changes submitted by another client, or when changes submitted by this client are conflicting with those in the remote destination. Each DataService sends conflict events only for items of this particular destination. Use the conflict event on the DataService if you need to handle conflicts for a set of related destinations at the same time.

The CONFLICT event type.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
conflict The Conflict object that holds the conflict that occurred.
message The Message associated with this event.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
faultevent  
Event object type: mx.data.events.DataServiceFaultEvent
DataServiceFaultEvent.type property = mx.data.events.DataServiceFaultEvent.FAULT

The DataServiceFaultEvent.FAULT event is dispatched when a service call fails due to an error. For example, a call to the fill() method dispatches this event if the call fails. You'll also get this event for each item which generates an error as part of a commit result. In this case, the DataServiceFaultEvent will contain the token returned by the commit, but the item and error message strings in the fault are specific to the item which caused the error.

The FAULT event type.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelabletrue, calling preventDefault() from the associated token's responder.fault method will prevent the service or operation from dispatching this event
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
fault The Fault object that holds the conflict that occurred.
item The item that generated the fault.
item The identity of of the item that generated the fault.
message The Message associated with this event.
token The token that represents the call to the method. Used in the asynchronous completion token pattern.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
messageevent  
Event object type: mx.messaging.events.MessageEvent
MessageEvent.type property = mx.messaging.events.MessageEvent.MESSAGE

The MessageEvent.MESSAGE event is dispatched when the remote destination pushes a notification of a data operation. For example, when data is updated in the remote destination an update operation is sent to all clients listening, this operation is converted to a message event on this DataService.

The MESSAGE event type; dispatched upon receipt of a message.

The value of this constant is "message".

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
messageThe message associated with this event.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
propertyChangeevent  
Event object type: mx.events.PropertyChangeEvent
PropertyChangeEvent.type property = mx.events.PropertyChangeEvent.PROPERTY_CHANGE

The PropertyChangeEvent.PROPERTY_CHANGE event is dispatched when a property of this service changes. This happens for the following properties:

The PropertyChangeEvent.PROPERTY_CHANGE constant defines the value of the type property of the event object for a PropertyChange event.

The properties of the event object have the following values:

PropertyValue
bubblesDetermined by the constructor; defaults to false.
cancelableDetermined by the constructor; defaults to false.
kindThe kind of change; PropertyChangeEventKind.UPDATE or PropertyChangeEventKind.DELETE.
oldValueThe original property value.
newValueThe new property value, if any.
propertyThe property that changed
sourceThe object that contains the property that changed.
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
resultevent  
Event object type: mx.rpc.events.ResultEvent
ResultEvent.type property = mx.rpc.events.ResultEvent.RESULT

The ResultEvent.RESULT event is dispatched when a service call successfully returns. For example a call to fill() will dispatch this event if the call is successful.

The RESULT event type.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelabletrue, preventDefault() from the associated token's responder.result method will prevent the service or operation from dispatching this event
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
message The Message associated with this event.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
resultResult that the RPC call returns.
tokenThe token that represents the indiviudal call to the method. Used in the asynchronous completion token pattern.




 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flex/2/langref/mx/data/DataService.html