mx.data

# Conflicts - AS3 ADEP Data Services

Package | mx.data
Class | public class Conflicts
Inheritance | Conflicts ArrayList EventDispatcher Object

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

The Conflicts class represents a list of conflicts. When conflicts are detected between changes made by a client and those made on the server, a Conflict object is created for each item which contains both the client and server versions of the data involved in that item at any given time.

You cannot commit any changes until all conflicts are resolved. At that point, the `DataService.commit()` method will call remove all of these conflicts. If you attempt to resolve a Conflict which was already resolved, an error is thrown.

An instance of this class can be accessed from the `DataService.conflicts` property.

Because this class implements `IList` it can be used with an `ArrayCollection.list` property, allowing it to participate as a data source for user interface controls and data binding.

Default MXML Property `source`

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | length : int [override] [read-only] The length of the source Array. | Conflicts
|  | resolved : Boolean [read-only] Indicates if there are any unresolved conflicts in the list. | Conflicts
|  | source : Array [override] An Array of Conflict objects. | Conflicts
|  | uid : String Provides access to the unique id for this list. | ArrayList

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | Conflicts(dataService:ConcreteDataService = null) Constructor. | Conflicts
|  | acceptAllClient():void This is a convenience method that iterates all of the conflicts within this list and invokes the Conflict.acceptClient() method. | Conflicts
|  | acceptAllServer():void This is a convenience method that iterates all of the conflicts within this list and invokes the Conflict.acceptClient() method. | Conflicts
|  | addAll(addList:IList):void Adds a list of items to the current list, placing them at the end of the list in the order they are passed. | ArrayList
|  | addAllAt(addList:IList, index:int):void Adds a list of items to the current list, placing them at the position index passed in to the function. | ArrayList
|  | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event. | EventDispatcher
|  | addItem(item:Object):void Add the specified item to the end of the list. | ArrayList
|  | addItemAt(item:Object, index:int):void Add the item at the specified index. | ArrayList
|  | dispatchEvent(event:Event):Boolean Dispatches an event into the event flow. | EventDispatcher
|  | getConflict(item:Object):Conflict If there is an outstanding conflict for the given object, returns that conflict. | Conflicts
|  | getItemAt(index:int, prefetch:int = 0):Object Get the item at the specified index. | ArrayList
|  | getItemIndex(item:Object):int Return the index of the item if it is in the list such that getItemAt(index) == item. | ArrayList
|  | hasEventListener(type:String):Boolean Checks whether the EventDispatcher object has any listeners registered for a specific type of event. | EventDispatcher
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | itemUpdated(item:Object, property:Object = null, oldValue:Object = null, newValue:Object = null):void Notify the view that an item has been updated. | ArrayList
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | raiseConflict(dataManager:DataManager, cause:DataMessage, serverObject:Object, conflictingProperties:Array):void This method is used by the DataServiceAdapter implementation when it need to raise a conflict because a change is in conflict with the server version. | Conflicts
|  | removeAll():void Remove all items from the list. | ArrayList
|  | removeAllResolved():void Removes all resolved conflicts from this collection. | Conflicts
|  | removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void Removes a listener from the EventDispatcher object. | EventDispatcher
|  | removeItem(item:Object):Boolean Removes the specified item from this list, should it exist. | ArrayList
|  | removeItemAt(index:int):Object Remove the item at the specified index and return it. | ArrayList
|  | setItemAt(item:Object, index:int):Object Place the item at the specified index. | ArrayList
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toArray():Array Return an Array that is populated in the same order as the IList implementation. | ArrayList
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String [override] Returns a String representation of this Conflicts object. | Conflicts
|  | valueOf():Object Returns the primitive value of the specified object. | Object
|  | willTrigger(type:String):Boolean Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. | EventDispatcher

Protected Methods
Hide Inherited Protected Methods
Show Inherited Protected Methods

| Method | Defined By
--- | --- | ---
|  | itemUpdateHandler(event:PropertyChangeEvent):void Called when any of the contained items in the list dispatch an ObjectChange event. | ArrayList
|  | startTrackUpdates(item:Object):void If the item is an IEventDispatcher, watch it for updates. | ArrayList
|  | stopTrackUpdates(item:Object):void If the item is an IEventDispatcher, stop watching it for updates. | ArrayList

Events
Click for more information on events
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | activate | [broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher
|  | collectionChange | Dispatched when the IList has been updated in some way. | ArrayList
|  | deactivate | [broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher

Property Detail

### length

property

`length:int` [read-only] [override]

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

The length of the `source` Array.

This property can be used as the source for data binding. When this property is modified, it dispatches the `collectionChange` event.

Implementation
`override public function get length():int`

### resolved

property

`resolved:Boolean` [read-only]

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

Indicates if there are any unresolved conflicts in the list. When this returns `true` all conflicts have been resolved and `DataService.commit()` can be called without an error.

This property can be used as the source for data binding. When this property is modified, it dispatches the `propertyChange` event.

Implementation
`public function get resolved():Boolean`

### source

property

`source:Array`[override]

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

An Array of Conflict objects.

Implementation
`override public function get source():Array`
`override public function set source(value:Array):void`
Constructor Detail

### Conflicts

()
Constructor

`public function Conflicts(dataService:ConcreteDataService = null)`

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

Constructor.

Parameters

| `dataService:ConcreteDataService` (default = `null`)`` — The DataService that caused the conflict.

Method Detail

### acceptAllClient

()
method

`public function acceptAllClient():void`

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

This is a convenience method that iterates all of the conflicts within this list and invokes the `Conflict.acceptClient()` method. Once completed this method will clear all of the conflicts in the list. Calling this method will requeue each local change and update all property values such that a subsequent call to `DataService.commit()` should succeed, allowing these changes to override the current ones.

Related API Elements

mx.data.Conflict.acceptClient()

### acceptAllServer

()
method

`public function acceptAllServer():void`

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

This is a convenience method that iterates all of the conflicts within this list and invokes the `Conflict.acceptClient()` method. Once completed this method will clear all of the conflicts in the list. Calling this method removes the conflicting local change and applies the property values found on each `Conflict.serverObject` within the list to each related local item.

Related API Elements

mx.data.Conflict.acceptServer()

### getConflict

()
method

`public function getConflict(item:Object):Conflict`

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

If there is an outstanding conflict for the given object, returns that conflict. Otherwise, returns null.

Parameters

| `item:Object` — The object to check for conflicts.

Returns

| `Conflict` — A Conflict object if there is a conflict, and null otherwise.

### raiseConflict

()
method

`public function raiseConflict(dataManager:DataManager, cause:DataMessage, serverObject:Object, conflictingProperties:Array):void`

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

This method is used by the DataServiceAdapter implementation when it need to raise a conflict because a change is in conflict with the server version.

Parameters

| `dataManager:DataManager` — The DataManager instance.
| `cause:DataMessage` — The DataMessage object that caused the conflict. The `cause` should be the pending change which is in conflict with the server.
| `serverObject:Object` — The value of the server object whose property was to be changed.
| `conflictingProperties:Array` — An Array of the names of the properties that were in conflict between the client change and the remote item state. All property names are String values and exist in the public namespace.

### removeAllResolved

()
method

`public function removeAllResolved():void`

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

Removes all resolved conflicts from this collection.

### toString

()
method

`override public function toString():String`

Language Version: | ActionScript 3.0

Product Version: | Adobe Digital Enterprise Platform Data Services for Java EE 3

Runtime Versions: | Flash Player 9, AIR 1.1

Returns a String representation of this Conflicts object.

Returns

| `String` — A String representation of this Conflicts object.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00