套件 | mx.collections |
類別 | public class ItemResponder |
繼承 | ItemResponder Object |
實作 | IResponder |
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
mx.rpc.IResponder
interface.
It represents a responder that lets you specify methods to be
called when a request is completed, either successfully or with an error.
The class object can also lets you provide data (a token) to be used by
the responder methods.
You use an ItemResponder
object in the catch
statement
of a try block that might result in getting remote data, as shown in the following
code:
import mx.collections.ItemResponder;
//...
try
{
//...
cursor.moveNext();
}
catch(e:ItemPendingError)
{
e.addResponder(new ItemResponder(myResultFunction, myFaultFunction, {info:"..."}));
}
The result method specified must have the following signature:
public function myResultFunction(result:Object, token:Object = null):void;
The fault method specified must have the following signature:
public function myFaultFunction(error:Object, token:Object = null):void;
Any other signature will result in a runtime error.
相關 API 元素
公用方法
方法 | 定義自 | ||
---|---|---|---|
Constructs an instance of the responder with the specified data and
handlers. | ItemResponder | ||
This method is called by a service when an error has been received. | ItemResponder | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
This method is called by a service when the return value has been
received. | ItemResponder | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object |
建構函式詳細資料
ItemResponder | () | 建構函式 |
public function ItemResponder(result:Function, fault:Function, token:Object = null)
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Constructs an instance of the responder with the specified data and handlers.
參數result:Function — Function that should be called when the request has
completed successfully.
Must have the following signature:
| |
fault:Function — Function that should be called when the request has
completed with errors.
Must have the following signature:
| |
token:Object (default = null ) — Object [optional] additional information to associate with
this request. This object is passed to the result and fault functions
as their second parameter.
|
方法詳細資訊
fault | () | 方法 |
result | () | 方法 |
Tue Jun 12 2018, 03:47 PM Z