ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
mx.data 

ItemReference  - AS3 ADEP Data Services

Packagemx.data
Classpublic dynamic class ItemReference
InheritanceItemReference Inheritance AsyncToken Inheritance EventDispatcher Inheritance Object
Implements IItemReference

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 ItemReference instance is returned from the DataService.getItem() and DataService.createItem() methods to provide a way to manage a reference to the remote object. The AsyncToken implementation that this class extends provides a list of responders to be notified of result and fault events that occur on the operation to retrieve the item (the get or the create). A binding can be made to the value of the result property that always maintains a reference to the managed instance. If the item is deleted in another client, the result property will be set to null. If a fault occurs and the DatService instance cannot retrieve the item, the invalid property is set to true. Listen for the fault event to get more information about what caused the error.

To release the reference to this managed item, call the ItemReference.releaseItem() method. This is similar to calling the DataService.releaseItem() method however, unlike the DataService.releaseItem() this method releases this reference rather than the first item instance found of that type. This occurs when more than one getItem() method call to retrieve the same item from different parts of an application is made.



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedmessage : IMessage
[read-only] Provides access to the associated message.
AsyncToken
 Inheritedresponders : Array
[read-only] An array of IResponder handlers that will be called when the asynchronous request completes.
AsyncToken
 Inheritedresult : Object
[read-only] The result that was returned by the associated RPC call.
AsyncToken
  valid : Boolean
Set to false if the ItemReference becomes invalid either because the server faulted when trying to retrieve the item or if the retrieved item was itself null.
ItemReference
Public Methods
 MethodDefined By
  
Constructor.
ItemReference
 Inherited
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
 Inherited
Adds a responder to an Array of responders.
AsyncToken
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Determines if this token has at least one mx.rpc.IResponder registered.
AsyncToken
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
releaseItem(copyStillManagedItems:Boolean = true, enableStillManagedCheck:Boolean = true):void
Releases the managed item reference retrieved with the getItem() or createItem() method call that returned this ItemReference.
ItemReference
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
 InheritedDispatched when a property of the channel set changes.AsyncToken
Property Detail

valid

property
valid:Boolean

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

Set to false if the ItemReference becomes invalid either because the server faulted when trying to retrieve the item or if the retrieved item was itself null. This property can be used to bind to your user interface controls to display status information for this item without having to listen for explicit fault events.

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 valid():Boolean
    public function set valid(value:Boolean):void
Constructor Detail

ItemReference

()Constructor
public function ItemReference(msg:IMessage)

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
msg:IMessage — A message object.
Method Detail

releaseItem

()method
public function releaseItem(copyStillManagedItems:Boolean = true, enableStillManagedCheck:Boolean = true):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

Releases the managed item reference retrieved with the getItem() or createItem() method call that returned this ItemReference. It is possible to have more than one ItemReference that points to the same item on the same client. Use this method to release the proper reference.

Parameters

copyStillManagedItems:Boolean (default = true) — Boolean indicating that a copy of this item should be placed in this ItemReference should the current item still be referenced. This can occur if more than one call to DataService.getItem() for this same item is made, or if this item is referenced by a collection returned from a call to DataService.fill().
 
enableStillManagedCheck:Boolean (default = true) — Boolean indicating if the item should be checked for additional references.