Packagecom.ericfeminella.utils
Classpublic final class DynamicBindingChain

Provides a mechanism for dynamically adding data bindings to a property on an object as well as management of all objects within the Binding Chain.

This class provides a wrapper implementation for the mx.bindings.utils API from which multiple objects within a Binding Chain can be managed and modified



Public Properties
 PropertyDefined by
  Host : Object
[read-only] Retrieves the host object which contains the property which other objects in the Binding chain are bound
DynamicBindingChain
  Property : String
[read-only] Retrieves the property which objects added to the Binding chain will be bound to
DynamicBindingChain
Public Methods
 MethodDefined by
  
DynamicBindingChain(owner:Object, property:String)
Constructor Creates a new DynamicBindingChain object and initializes properties.
DynamicBindingChain
  
addHandlerToObject(instance:Object, handler:Function):void
Adds a handler function to an object which has been added to the DynamicBindingChain instance which is invoked whenever the value of the host property in the binding chain changes
DynamicBindingChain
  
addToBindingChain(instance:Object, property:String):void
Adds a new object to the current binding chain for this DynamicBindingChain instance
DynamicBindingChain
  
getCurrentValue(instance:Object):Object
Retrieves the property value of each object which has been added to the DynamicBindingChain instance
DynamicBindingChain
  
objectIsBound(instance:Object):Boolean
Determines if the object property of a bindable object which has been added to the DynamicBindingChain instance is currently bound to the value of the host property
DynamicBindingChain
  
Determines the amount of objects currently added to the Binding Chain
DynamicBindingChain
  
removeFromBindingChain(instance:Object):void
Removes binding from a dynamic bindable object property which has been added to the DynamicBindingChain instance
DynamicBindingChain
Property detail
Hostproperty
Host:Object  [read-only]

Retrieves the host object which contains the property which other objects in the Binding chain are bound

Implementation
    public function get Host():Object
Propertyproperty 
Property:String  [read-only]

Retrieves the property which objects added to the Binding chain will be bound to

Implementation
    public function get Property():String
Constructor detail
DynamicBindingChain()constructor
public function DynamicBindingChain(owner:Object, property:String)

Constructor Creates a new DynamicBindingChain object and initializes properties.

DynamicBindingChain objects can be used to wrap the mx.binding.utils API in order to manage the binding chain throughout the lifecycle of a DynamicBindingChain instance

Parameters
owner:Object — owner of the properrty from which the host object is to be bound
 
property:String — property that the newly binded property will be bound
Method detail
addHandlerToObject()method
public function addHandlerToObject(instance:Object, handler:Function):void

Adds a handler function to an object which has been added to the DynamicBindingChain instance which is invoked whenever the value of the host property in the binding chain changes

Parameters
instance:Object — instance which contains the bound property
 
handler:Function — which handles property change updates
addToBindingChain()method 
public function addToBindingChain(instance:Object, property:String):void

Adds a new object to the current binding chain for this DynamicBindingChain instance

Parameters
instance:Object — host object from which to add a bindable property. This object will be used as the key for managing the ChangeWatcher instance created by adding the dynamic binding
 
property:String — property on the host object which is to be made bindable
getCurrentValue()method 
public function getCurrentValue(instance:Object):Object

Retrieves the property value of each object which has been added to the DynamicBindingChain instance

Parameters
instance:Object — instance which contains the bound property

Returns
Object — the current bound property value
objectIsBound()method 
public function objectIsBound(instance:Object):Boolean

Determines if the object property of a bindable object which has been added to the DynamicBindingChain instance is currently bound to the value of the host property

Parameters
instance:Object — instance which contains the bound property

Returns
Boolean — true if binding has been added, otherwise false
objectsInChain()method 
public function objectsInChain():int

Determines the amount of objects currently added to the Binding Chain

Returns
int — the length of the Binding Chain
removeFromBindingChain()method 
public function removeFromBindingChain(instance:Object):void

Removes binding from a dynamic bindable object property which has been added to the DynamicBindingChain instance

Parameters
instance:Object — instance which contains the bound property