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}"/>
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
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
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
public function ActionBinder()
public function perform(... rest):void
Performs the action on the SuperModel with the desired params
Parameters
Event object type: com.jadbox.flashmvc.SuperModelEvent
Dispatched when the action was added to the SuperModel
Event object type: com.jadbox.flashmvc.SuperModelEvent
Dispatched when the action completes
Event object type: com.jadbox.flashmvc.SuperModelEvent
/ Dispatched when the action completes, but only when this component performed it.
Event object type: com.jadbox.flashmvc.SuperModelEvent
Dispatched when the action was disabled on the SuperModel
Event object type: com.jadbox.flashmvc.SuperModelEvent
Dispatched when the action was enabled on the SuperModel
Event object type: com.jadbox.flashmvc.SuperModelEvent
Dispatched when the action completes by actionHelper.fail();
Event object type: com.jadbox.flashmvc.SuperModelEvent
Dispatched when at least one of the actions of this name is performing
Event object type: com.jadbox.flashmvc.SuperModelEvent
Dispatched when the action was removed to the SuperModel
Event object type: com.jadbox.flashmvc.SuperModelEvent
Dispatched when all actions of this name are not performing