| Package | mx.data |
| Class | public dynamic class ItemReference |
| Inheritance | ItemReference AsyncToken EventDispatcher Object |
DataService.getItem() and
DataService.createItem() methods to provide you with a way
to manage your 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). You can bind 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 is 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.
When you want to release your reference to this managed item, you should call
the ItemReference.releaseItem() method. This is similar to calling
the DataService.releaseItem() method but if you are holding references to the
ItemReference instance you should use this version of the releaseItem() method to
ensure that you release the correct reference to the item in case you have
made more than one getItem() method call to retrieve the same item from different parts
of your application.
| Property | Defined by | ||
|---|---|---|---|
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | |
![]() | message : IMessage
Provides access to the associated message.
| AsyncToken | |
![]() | prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object | |
![]() | responders : Array
An array of IResponder handlers that will be called when
the asynchronous request completes.
| AsyncToken | |
![]() | result : Object
The result that was returned by the associated RPC call.
| AsyncToken | |
| valid : Boolean = false
Set to
true 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 | ||
| valid : Boolean = false | ItemReference | ||
| Method | Defined by | ||
|---|---|---|---|
|
ItemReference(msg:IMessage)
| ItemReference | ||
![]() |
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 | |
![]() |
addResponder adds a responder to an Array of responders. | AsyncToken | |
![]() |
Dispatches an event into the event flow.
| EventDispatcher | |
![]() |
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event.
| EventDispatcher | |
![]() |
Indicates whether an object has a specified property defined.
| Object | |
![]() |
Determines if this token has at least one
mx.rpc.IResponder registered. | AsyncToken | |
![]() |
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter.
| Object | |
![]() |
Indicates whether the specified property exists and is enumerable.
| Object | |
|
Releases the managed item reference retrieved with the
getItem() or | ItemReference | ||
![]() |
Removes a listener from the EventDispatcher object.
| EventDispatcher | |
![]() |
Sets the availability of a dynamic property for loop operations.
| Object | |
![]() |
Returns the string representation of the specified object.
| Object | |
![]() |
Returns the primitive value of the specified object.
| Object | |
![]() |
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type.
| EventDispatcher | |
| valid | property |
public var valid:Boolean = false
Set to true if the ItemReference becomes invalid
either because the server faulted when trying to retrieve the item
or if the retrieved item was itself null. You can use this property
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.
| valid | property |
public var valid:Boolean = false
| ItemReference | () | constructor |
| releaseItem | () | method |
public function releaseItem(clear:Boolean = true):void
Releases the managed item reference retrieved with the
getItem() or createItem() method call that returned this ItemReference. Since it
is possible to have more than one ItemReference that points to the
same item on the same client, this method ensures you release the proper
reference.
clear:Boolean (default = true) |