Packagejp.co.fujitsu.reffi.client.flex.action
Classpublic class FlexibleAction
InheritanceFlexibleAction Inheritance AbstractAction

[概 要]

アクションの処理フローを実装する、アクション基底クラスです.

[詳 細]

継承クラスはexecute(ParameterMapping)メソッドを実装して処理を実装します。
AbstractActionが提供する基本的な機能+機能モデルをコントローラ経由で呼び出す為のメソッドを持ちます。

FlexibleActionにはBaseAction#nextModelメソッドやBaseAction#successForwardメソッドのように、 予め用意された処理フローが有りません。
このクラスを基底アクションクラスとして使用する場合は、executeメソッド内で任意に処理フローを記述します。

[備 考]

FlexibleActionではBaseActionのような非同期処理のシーケンシャルな実行がサポートされません。
非同期処理Aの実行後に処理Bを行うような機能の場合、Aの終了イベントリスナ内でBを実行するように実装します。



入力値バリデーション、サーバロジック実行等を任意のタイミングで実行する
        public class AddNumberByRPCAction extends FlexibleAction {

            override public function execute(parameterMapping:ParameterMapping):void {
                
                var tiNum1:TextInput = TextInput(getComponentByName("panel.tiNum1"));
                var tiNum2:TextInput = TextInput(getComponentByName("panel.tiNum2"));
    
                var tiNum1Validator:NumberValidator = new NumberValidator();
                tiNum1Validator.source = tiNum1;
                tiNum1Validator.property = "text";
                tiNum1Validator.domain = "int";
                tiNum1Validator.required = true;
    
                var tiNum2Validator:NumberValidator = new NumberValidator();
                tiNum2Validator.source = tiNum2;
                tiNum2Validator.property = "text";
                tiNum2Validator.domain = "int";
                tiNum2Validator.required = true;
    
                var validators:Array = new Array();            
                validators.push(tiNum1Validator);
                validators.push(tiNum2Validator);
    
                var errors:ValidateErrors = validate(validators);
                if(errors.hasError()) {
                    return;
                }
                
                var addRpc:RemoteObjectCore = new RemoteObjectCore();
                addRpc.remoteDestination = "orderDestination";
                addRpc.methodName = "add";
                addRpc.addRpcParameter(tiNum1.text);
                addRpc.addRpcParameter(tiNum2.text);
                
                var successFunction:Function = function(evt:ModelProcessEvent):void {
                    var sum:int = ResultEvent(evt.cause).result as int;
                    var tiSum:TextInput = TextInput(getComponentByName("panel.tiSum"));
                    tiSum.text = sum.toString();
                };
    
                var failureFunction:Function = function(evt:ModelProcessEvent):void {
                    Alert.show("RPC呼び出し中にエラーが発生しました。\n " + evt.cause.toString());
                };
    
                runModel(addRpc, parameterMapping, successFunction, failureFunction);
            }        
         }
  

Copyright (c) 2008-2009 FUJITSU Japan All rights reserved.



Public Properties
 PropertyDefined by
 Inheritedcontroller : BaseController

[概 要]

このアクションを起動したコントローラオブジェクトです.
AbstractAction
 Inheriteddocument : Object

[概 要]

このアクション(イベント)を起こしたUIComponentが所属するdocumentオブジェクトを設定します.
AbstractAction
 InheritedparameterMapping : ParameterMapping

[概 要]

MVC各レイヤを伝播するパラメータオブジェクトです.
AbstractAction
Public Methods
 MethodDefined by
  

[概 要]

コントローラにコールされるアクションの主幹メソッドです.
FlexibleAction
Protected Methods
 MethodDefined by
 Inherited
addPermanent(key:Object, value:Object):void

[概 要]

nSWF間で共有可能な恒久領域に、引数keyで値valueを設定します.
AbstractAction
 Inherited
addPopUp(name:String, displayObject:IFlexDisplayObject, modal:Boolean = false, centered:Boolean = false):void

[概 要]

ポップアップ画面を表示します.
AbstractAction
 Inherited
addSingletonPopUp(name:String, displayObject:IFlexDisplayObject, modal:Boolean = false, centered:Boolean = false):void

[概 要]

シングルトンポップアップ画面を表示します.
AbstractAction
  
execute(parameterMapping:ParameterMapping):void

[概 要]

アクション処理を実装するメソッドです.
FlexibleAction
 Inherited
getApplication():Application

[概 要]

このアクションを起動したコンポーネントが所属するApplicationを取得します.
AbstractAction
 Inherited
getComponentById(id:String, searchRange:int = 0x03):DisplayObject

[概 要]

第一引数idをid属性として持つ画面コンポーネントを取得します.
AbstractAction
 Inherited
getComponentByIdFrom(container:DisplayObjectContainer, id:String):DisplayObject

[概 要]

第一引数containerから、第二引数idをid属性として持つ画面コンポーネントを取得します.
AbstractAction
 Inherited
getComponentByName(namePattern:String, searchRange:int = 0x03):DisplayObject

[概 要]

第一引数namePatternをname属性として持つ画面コンポーネントを取得します.
AbstractAction
 Inherited
getComponentByNameFrom(container:DisplayObjectContainer, namePattern:String):DisplayObject

[概 要]

第一引数containerから、第二引数namePatternをname属性として持つ画面コンポーネントを取得します.
AbstractAction
 Inherited
getComponentByNameParentTrace(namePattern:String):DisplayObject

[概 要]

第一引数namePatternをname属性として持つ画面コンポーネントを取得します.
AbstractAction
 Inherited
getComponentsById(id:String, searchRange:int = 0x03):Array

[概 要]

第一引数idをid属性として持つ画面コンポーネント配列を取得します.
AbstractAction
 Inherited
getComponentsByName(namePattern:String, searchRange:int = 0x03):Array

[概 要]

第一引数namePatternをname属性として持つ画面コンポーネント配列を取得します.
AbstractAction
 Inherited
getComponentsByNameFrom(container:DisplayObjectContainer, namePattern:String):Array

[概 要]

第一引数containerから、第二引数namePatternをname属性として持つ画面コンポーネント配列を取得します.
AbstractAction
 Inherited

[概 要]

このアクションを起動したイベントのcurrentTargetを取得します.
AbstractAction
 Inherited
getEventSourceObject():DisplayObject

[概 要]

恒久的なイベントカレントターゲットです.
AbstractAction
 Inherited
getEventTarget():Object

[概 要]

このアクションを起動したイベントのtargetを取得します.
AbstractAction
 Inherited

[概 要]

AVM上にロードされているBaseControllerから、引数nameをnameとして持つものを取得します.
AbstractAction
 Inherited
getLoadedControllers():Dictionary

[概 要]

AVM上にロードされているBaseControllerのマッピングを取得します.
AbstractAction
 Inherited
getObjectById(id:String):Object

[概 要]

引数idをid属性として持つオブジェクトを取得します.
AbstractAction
 Inherited
getPermanent(key:Object):Object

[概 要]

nSWF間で共有可能な恒久領域から、引数keyに対応する値を取得します.
AbstractAction
 Inherited
getPopUp(name:String):Array

[概 要]

既に表示されているポップアップ画面インスタンス配列を取得します.
AbstractAction
 Inherited
getSingletonPopUp(name:String):IFlexDisplayObject

[概 要]

既に表示されている重複を許可しないポップアップ画面インスタンスを取得します.
AbstractAction
 Inherited
isExistPopUp(name:String):Boolean

[概 要]

引数で指定した名前を持つポップアップ画面が既に画面表示されているかどうか調べます.
AbstractAction
 Inherited
removeAllPopUp():Boolean

[概 要]

全てのポップアップ画面を画面から消去します.
AbstractAction
 Inherited
removePermanent(key:Object):void

[概 要]

nSWF間で共有可能な恒久領域から、引数keyを削除します.
AbstractAction
 Inherited
removePopUp(name:String):Boolean

[概 要]

引数windowNameに対応するポップアップ画面を画面から消去します.
AbstractAction
  
runModel(model:BaseModel, parameterMapping:ParameterMapping, successFunction:Function = null, failureFunction:Function = null):void

[概 要]

機能モデルをコントローラ経由で呼び出します.
FlexibleAction
 Inherited
validate(validators:Array):ValidateErrors

[概 要]

バリデーションを行うメソッドです.
AbstractAction
Method detail
execute()method
protected function execute(parameterMapping:ParameterMapping):void

[概 要]

アクション処理を実装するメソッドです.

[詳 細]

FlexibleAction継承アクションは、このメソッドをオーバーライドして、 バリデーション、モデル実行、コンポーネント編集等の処理を任意に実装します。

[備 考]

パラメータ
parameterMapping:ParameterMapping — MVC各レイヤを伝播するパラメータオブジェクト
run()method 
public override function run(parameterMapping:ParameterMapping):ParameterMapping

[概 要]

コントローラにコールされるアクションの主幹メソッドです.

[詳 細]

executeメソッドをテンプレートコールします。

[備 考]

パラメータ
parameterMapping:ParameterMapping — MVC各レイヤを伝播するパラメータオブジェクト

戻り値
ParameterMapping — null
runModel()method 
protected function runModel(model:BaseModel, parameterMapping:ParameterMapping, successFunction:Function = null, failureFunction:Function = null):void

[概 要]

機能モデルをコントローラ経由で呼び出します.

[詳 細]

コントローラのモデル実行機能に引数modelの実行を委譲します。

[備 考]

パラメータ
model:BaseModel — コントローラに実行委譲するBaseModel継承オブジェクト
 
parameterMapping:ParameterMapping — MVC各レイヤを伝播するパラメータオブジェクト
 
successFunction:Function (default = null) — 第一引数modelのModelProcessEvent.SUCCESSイベントハンドラ
 
failureFunction:Function (default = null) — 第一引数modelのModelProcessEvent.FAILUREイベントハンドラ