Packageflexlib.containers
Classpublic class AdvancedForm
InheritanceAdvancedForm Inheritance mx.containers.Form

The Advanced Form component provides Reset, Undo and Redo functionality.

The Advanced Form component provides Reset, Undo and Redo functionality. Undo and Redo are accessed by pressing "ctrl-Z" and "ctrl-Y" repsectively.

MXML SyntaxexpandedHide MXML Syntax
    <flexlib:AdvancedForm
   	  Properties
   	  undoHistorySize="5"
   	  modelType="shared|memory"
         >
      ...
        child tags
      ...
    </flexlib:AdvancedForm>
    


Public Properties
 PropertyDefined By
  isValid : Boolean
Property that allows for one place to know if the From is valid Default to true, if any Validators are present then it will be set to false
AdvancedForm
  modelType : String
The modelStack handles the data.
AdvancedForm
  undoHistorySize : int
The undoHistorySize defaults the number of undos.
AdvancedForm
Protected Properties
 PropertyDefined By
  modelStack : Object
AdvancedForm
  _modelType : String = shared
AdvancedForm
  noSnapshotFlag : Boolean = false
AdvancedForm
  resetSnapshotKey : String = reset
Key for reset snapshot
AdvancedForm
  undoCounter : int = 0
AdvancedForm
  undoCurrentIndex : int = -1
AdvancedForm
  _undoHistorySize : int = 5
AdvancedForm
  validators : Object
LookupTable of isValid flags
AdvancedForm
Public Methods
 MethodDefined By
  
resetForm():void
Resets values of the form
AdvancedForm
Protected Methods
 MethodDefined By
  
[override] Creates snapshot of values for reseting
AdvancedForm
  
controlChange(event:Event):void
AdvancedForm
  
doRedo():void
AdvancedForm
  
doUndo():void
AdvancedForm
  
AdvancedForm
  
getSnapshotKey(coutner:int):String
AdvancedForm
  
myKeyDownHandler(event:KeyboardEvent):void
AdvancedForm
  
resetValues(obj:Object, snapshotKey:String):void
AdvancedForm
  
setValidatorListenerEvents(event:Event):void
Loop through all Validtors at the same level as the Form and set a Event listener for Valid and Invalid
AdvancedForm
  
setValidFlag(event:ValidationResultEvent):void
Handles all valid and invalid events on the validators
AdvancedForm
  
snapshotValues(obj:Object, snapshotKey:String):void
AdvancedForm
  
strChildren(obj:Object):String
Gather references and defaults of all the children
AdvancedForm
  
AdvancedForm
  
textInputChange(event:FocusEvent):void
AdvancedForm
Property Detail
_modelTypeproperty
protected var _modelType:String = shared

_undoHistorySizeproperty 
protected var _undoHistorySize:int = 5

isValidproperty 
isValid:Boolean

Property that allows for one place to know if the From is valid Default to true, if any Validators are present then it will be set to false

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


Implementation
    public function get isValid():Boolean
    public function set isValid(value:Boolean):void
modelStackproperty 
protected var modelStack:Object

modelTypeproperty 
modelType:String

The modelStack handles the data.

The default value is true.


Implementation
    public function get modelType():String
    public function set modelType(value:String):void
noSnapshotFlagproperty 
protected var noSnapshotFlag:Boolean = false

resetSnapshotKeyproperty 
protected var resetSnapshotKey:String = reset

Key for reset snapshot

undoCounterproperty 
protected var undoCounter:int = 0

undoCurrentIndexproperty 
protected var undoCurrentIndex:int = -1

undoHistorySizeproperty 
undoHistorySize:int

The undoHistorySize defaults the number of undos.

The default value is true.


Implementation
    public function get undoHistorySize():int
    public function set undoHistorySize(value:int):void
validatorsproperty 
protected var validators:Object

LookupTable of isValid flags

Method Detail
childrenCreated()method
override protected function childrenCreated():void

Creates snapshot of values for reseting

controlChange()method 
protected function controlChange(event:Event):void

Parameters

event:Event

doRedo()method 
protected function doRedo():void

doUndo()method 
protected function doUndo():void

getLastestSnapshot()method 
protected function getLastestSnapshot():Object

Returns
Object
getSnapshotKey()method 
protected function getSnapshotKey(coutner:int):String

Parameters

coutner:int

Returns
String
myKeyDownHandler()method 
protected function myKeyDownHandler(event:KeyboardEvent):void

Parameters

event:KeyboardEvent

resetForm()method 
public function resetForm():void

Resets values of the form

resetValues()method 
protected function resetValues(obj:Object, snapshotKey:String):void

Parameters

obj:Object
 
snapshotKey:String

setValidatorListenerEvents()method 
protected function setValidatorListenerEvents(event:Event):void

Loop through all Validtors at the same level as the Form and set a Event listener for Valid and Invalid

Parameters

event:Event

setValidFlag()method 
protected function setValidFlag(event:ValidationResultEvent):void

Handles all valid and invalid events on the validators

Parameters

event:ValidationResultEvent

snapshotValues()method 
protected function snapshotValues(obj:Object, snapshotKey:String):void

Parameters

obj:Object
 
snapshotKey:String

strChildren()method 
protected function strChildren(obj:Object):String

Gather references and defaults of all the children

Parameters

obj:Object

Returns
String
takeSnapshot()method 
protected function takeSnapshot():void

textInputChange()method 
protected function textInputChange(event:FocusEvent):void

Parameters

event:FocusEvent