Packagecom.jadbox.flashmvc.flex
Classpublic class ActionBinder
InheritanceActionBinder Inheritance mx.core.UIComponent

Wraps FlashMVC SuperModel operations for a single action to a MXML component for ease of use.


Example
The below code is an example usage of this within the view for a Login feature in an simple application:

<flashMVC:ActionBinder superModel="{mySuperModel}"
action="{mySuperModel.LOGIN}"
id="LoginBinder"
actionComplete="{trace('Login action completed')}"
actionEnable="{trace('action enabled')}"
actionDisable="{trace('action disabled')}"
actionPerforming="{trace('working')}"
actionStoppedPerforming="{trace('stopped working')}" />

<mx:Button label="Perform Action with ActionBinder"
enabled="{LoginBinder.actionEnabled}"
click="{LoginBinder.perform(username.text,password.text)}"/>
<mx:Button label="{LoginBinder.actionEnabled?'Disable Login':'Enable Login'}"
click="{LoginBinder.actionEnabled=LoginBinder.actionEnabled?false:true}"/>



Public Properties
 PropertyDefined by
  action : String
Sets or returns the action name to use with this utility
ActionBinder
  actionEnabled : Boolean
Sets or returns the action enabled state on the SuperModel
ActionBinder
  superModel : SuperModel
Sets the SuperModel reference that will have the action to monitor
ActionBinder
Public Methods
 MethodDefined by
  
ActionBinder
  
perform(... rest):void
Performs the action on the SuperModel with the desired params
ActionBinder
Events
 EventSummaryDefined by
   Dispatched when the action was added to the SuperModel ActionBinder
   Dispatched when the action completes ActionBinder
   / Dispatched when the action completes, but only when this component performed it.ActionBinder
   Dispatched when the action was disabled on the SuperModel ActionBinder
   Dispatched when the action was enabled on the SuperModel ActionBinder
   Dispatched when the action completes by actionHelper.fail(); ActionBinder
   Dispatched when at least one of the actions of this name is performing ActionBinder
   Dispatched when the action was removed to the SuperModel ActionBinder
   Dispatched when all actions of this name are not performing ActionBinder
Property detail
actionproperty
action:String  [read-write]

Sets or returns the action name to use with this utility

Implementation
    public function get action():String
    public function set action(value:String):void
actionEnabledproperty 
actionEnabled:Boolean  [read-write]

Sets or returns the action enabled state on the SuperModel

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

Implementation
    public function get actionEnabled():Boolean
    public function set actionEnabled(value:Boolean):void
superModelproperty 
superModel:SuperModel  [read-write]

Sets the SuperModel reference that will have the action to monitor

Implementation
    public function get superModel():SuperModel
    public function set superModel(value:SuperModel):void
Constructor detail
ActionBinder()constructor
public function ActionBinder()
Method detail
perform()method
public function perform(... rest):void

Performs the action on the SuperModel with the desired params

Parameters
... rest
Event detail
actionAddedevent 
Event object type: com.jadbox.flashmvc.SuperModelEvent

Dispatched when the action was added to the SuperModel

actionCompleteevent  
Event object type: com.jadbox.flashmvc.SuperModelEvent

Dispatched when the action completes

actionCompleteLocalevent  
Event object type: com.jadbox.flashmvc.SuperModelEvent

/ Dispatched when the action completes, but only when this component performed it.

actionDisableevent  
Event object type: com.jadbox.flashmvc.SuperModelEvent

Dispatched when the action was disabled on the SuperModel

actionEnableevent  
Event object type: com.jadbox.flashmvc.SuperModelEvent

Dispatched when the action was enabled on the SuperModel

actionFailevent  
Event object type: com.jadbox.flashmvc.SuperModelEvent

Dispatched when the action completes by actionHelper.fail();

actionPerformingevent  
Event object type: com.jadbox.flashmvc.SuperModelEvent

Dispatched when at least one of the actions of this name is performing

actionRemovedevent  
Event object type: com.jadbox.flashmvc.SuperModelEvent

Dispatched when the action was removed to the SuperModel

actionStoppedPerformingevent  
Event object type: com.jadbox.flashmvc.SuperModelEvent

Dispatched when all actions of this name are not performing