| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- saved from url=(0014)about:internet --><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="stylesheet" href="../../style.css" type="text/css" media="screen"><link rel="stylesheet" href="../../print.css" type="text/css" media="print"><link rel="stylesheet" href="../../override.css" type="text/css"><meta name="keywords" content="CallResponder,mx.rpc.CallResponder,_keepLastResult,arguments,channelSet,content,destination,faultCode,faultDetail,faultString,keepLastResult,keepLastResult,lastResult,lastResult,makeObjectsBindable,managers,message,name,operationManager,operations,properties,requestTimeout,responders,result,resultElementType,resultType,rootCause,service,token,addResponder,cancel,clearResult,disconnect,fault,fault,fault,fault,getOperation,hasPendingRequestForMessage,hasResponder,initialize,invoke,logout,result,result,result,result,send,setCredentials,setRemoteCredentials,setResult,toString"><title>mx.rpc.CallResponder</title></head><body><script language="javascript" type="text/javascript" src="../../asdoc.js"></script><script language="javascript" type="text/javascript" src="../../help.js"></script><script language="javascript" type="text/javascript" src="../../cookies.js"></script><script language="javascript" type="text/javascript"><!-- |
| asdocTitle = 'CallResponder - ApacheFlex API Reference'; |
| var baseRef = '../../'; |
| window.onload = configPage; |
| --></script> |
| <script type="text/javascript"> |
| scrollToNameAnchor(); |
| </script><table class="titleTable" cellpadding="0" cellspacing="0" id="titleTable" style="display:none"><tr><td class="titleTableTitle" align="left">Apache Flex 4.16.1 API Reference </td><td class="titleTableTopNav" align="right"><a href="../../package-summary.html" onclick="loadClassListFrame('../../all-classes.html')">All Packages</a> | <a href="../../class-summary.html" onclick="loadClassListFrame('../../all-classes.html')">All Classes</a> | <a href="../../all-index-A.html" onclick="loadClassListFrame('../../index-list.html')">Index</a> | <a id="framesLink1" href="../../index.html?mx/rpc/CallResponder.html&mx/rpc/class-list.html">Frames</a><a id="noFramesLink1" style="display:none" href="" onclick="parent.location=document.location"> No Frames </a></td><td class="titleTableLogo" align="right" rowspan="3"><img src="../../images/logo.jpg" class="logoImage" alt="AdobeLogo" title="AdobeLogo"></td></tr><tr class="titleTableRow2"><td class="titleTableSubTitle" id="subTitle" align="left">CallResponder</td><td class="titleTableSubNav" id="subNav" align="right"><a href="#propertySummary">Properties</a> | <a href="#methodSummary">Methods</a> | <a href="#eventSummary">Events</a></td></tr><tr class="titleTableRow3"><td colspan="3"> </td></tr></table><script language="javascript" type="text/javascript" xml:space="preserve"> |
| <!-- |
| |
| if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("CallResponder"); titleBar_setSubNav(false,true,false,false,false,false,true,false,true,false,false ,false,false,false,false,false);} |
| --> |
| </script><div xmlns:fn="http://www.w3.org/2005/xpath-functions" class="MainContent"><table class="classHeaderTable" cellpadding="0" cellspacing="0"><tr><td class="classHeaderTableLabel">Package</td><td><a href="package-detail.html" onclick="javascript:loadClassListFrame('class-list.html')">mx.rpc</a></td></tr><tr><td class="classHeaderTableLabel">Class</td><td class="classSignature">public class CallResponder</td></tr><tr><td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">CallResponder <img src="../../images/inherit-arrow.gif" title="Inheritance" alt="Inheritance" class="inheritArrow"> flash.events.EventDispatcher</td></tr><tr><td class="classHeaderTableLabel">Implements</td><td> <a href="../../mx/rpc/IResponder.html">IResponder</a></td></tr></table><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version : </b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version : </b></td><td>Flex 3</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions : </b></td><td>Flash Player 9, AIR 1.1</td></tr></table><p></p><p></p><p></p><p></p> |
| This component helps you manage the results for asynchronous calls made from |
| RPC based services, typically from MXML components. While each individual service |
| and operation dispatches result and fault events, it is common to need to use the |
| same operation in different parts of your application. Using one event listener |
| or lastResult value across the entire application can be awkward. Rather than creating |
| two service components which refer to the same service, you can use a simple lightweight |
| CallResponder to manage the event listeners and lastResult value for a specific invocation |
| of a service. |
| <p> |
| You set the token property of this component to the AsyncToken returned by the |
| service. You can then add event listeners on this component instead of having to |
| add them to each AsyncToken returned. This component also maintains the |
| lastResult property which is a copy of the value returned by the last successful |
| result event dispatched by a token monitored by this service. Though you can |
| bind to either the <code>callResponder.token.result</code> or |
| <code>callResponder.lastResult</code>, the latter will be preserved while a second |
| call to the same service is in progress while the former will be reset as soon |
| as a new service invocation is started. |
| </p> |
| |
| <p></p><br/><hr></div><a name="propertySummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Properties</div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableProperty"><tr><th> </th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><a href="#lastResult" class="signatureLink">lastResult</a> : *<div class="summaryTableDescription"> |
| This property stores the result property of the token each time it |
| delivers a successful result.</div></td><td class="summaryTableOwnerCol">CallResponder</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><a href="#token" class="signatureLink">token</a> : <a href="../../mx/rpc/AsyncToken.html">AsyncToken</a><div class="summaryTableDescription"> |
| Each CallResponder dispatches result and fault events received |
| from a single token.</div></td><td class="summaryTableOwnerCol">CallResponder</td></tr></table></div><a name="methodSummary"></a><div class="summarySection"><div class="summaryTableTitle">Public Methods </div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableMethod"><tr><th> </th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#fault()" class="signatureLink">fault</a>(data:Object):void</div><div class="summaryTableDescription"> |
| This method is called by the AsyncToken when it wants to deliver a |
| FaultEvent to the CallResponder.</div></td><td class="summaryTableOwnerCol">CallResponder</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#result()" class="signatureLink">result</a>(data:Object):void</div><div class="summaryTableDescription"> |
| This method is called by the AsyncToken when it wants to deliver a |
| ResultEvent to the CallResponder.</div></td><td class="summaryTableOwnerCol">CallResponder</td></tr></table></div><a name="eventSummary"></a><div class="summarySection"><div class="summaryTableTitle">Events</div><table cellspacing="0" cellpadding="3" class="summaryTable " id="summaryTableEvent"><tr><th> </th><th colspan="2">Event</th><th> Summary </th><th class="summaryTableOwnerCol">Defined By</th></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#event:fault" class="signatureLink">fault</a></div></td><td class="summaryTableDescription summaryTableCol">Dispatched when an Operation call fails.</td><td class="summaryTableOwnerCol">CallResponder</td></tr><tr class=""><td class="summaryTablePaddingCol"> </td><td class="summaryTableInheritanceCol"> </td><td class="summaryTableSignatureCol"><div class="summarySignature"><a href="#event:result" class="signatureLink">result</a></div></td><td class="summaryTableDescription summaryTableCol">Dispatched when an Operation invocation successfully returns.</td><td class="summaryTableOwnerCol">CallResponder</td></tr></table></div><script language="javascript" type="text/javascript"><!-- |
| showHideInherited(); |
| --></script><div class="MainContent"><div class="detailSectionHeader">Property Detail</div><a name="propertyDetail"></a><a name="lastResult"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">lastResult</td><td class="detailHeaderType">property</td></tr></table><div class="detailBody"><code>lastResult:*</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version : </b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version : </b></td><td>Flex 3</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions : </b></td><td>Flash Player 9, AIR 1.1</td></tr></table><p></p><p></p><p> |
| This property stores the result property of the token each time it |
| delivers a successful result. You can bind to or access this property |
| instead of the token.result property to keep your code from seeing that |
| value cleared out on the second and subsequent call to a particular service |
| method. Additionally, if a fault occurs this value will still be set to |
| the last successful result returned by a token monitored by this CallResponder. |
| |
| </p><p>This property can be used as the source for data binding.</p><br/><span class="label"> Implementation </span><br/><code> public function get lastResult():*</code><br/><code> public function set lastResult(value:any):void</code><br/></div><a name="propertyDetail"></a><a name="token"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">token</td><td class="detailHeaderType">property</td><td class="detailHeaderRule"> </td></tr></table><div class="detailBody"><code>token:<a href="../../mx/rpc/AsyncToken.html">AsyncToken</a></code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version : </b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version : </b></td><td>Flex 3</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions : </b></td><td>Flash Player 9, AIR 1.1</td></tr></table><p></p><p></p><p> |
| Each CallResponder dispatches result and fault events received |
| from a single token. This property value specifies that token. You typically |
| set this property to the AsyncToken object returned by the service. |
| |
| </p><p>This property can be used as the source for data binding.</p><br/><span class="label"> Implementation </span><br/><code> public function get token():<a href="../../mx/rpc/AsyncToken.html">AsyncToken</a></code><br/><code> public function set token(value:<a href="../../mx/rpc/AsyncToken.html">AsyncToken</a>):void</code><br/></div><a name="methodDetail"></a><div class="detailSectionHeader">Method Detail</div><a name="fault()"></a><a name="fault(Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">fault</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td></tr></table><div class="detailBody"><code> public function fault(data:Object):void</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version : </b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version : </b></td><td>Flex 3</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions : </b></td><td>Flash Player 9, AIR 1.1</td></tr></table><p></p><p></p><p> |
| This method is called by the AsyncToken when it wants to deliver a |
| <code>FaultEvent</code> to the CallResponder. You do not call |
| this method directly. |
| </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">data</span>:Object</code> — The FaultEvent delivered by the AsyncToken |
| |
| </td></tr></table></p></div><a name="result()"></a><a name="result(Object)"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">result</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule"> </td></tr></table><div class="detailBody"><code> public function result(data:Object):void</code><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version : </b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version : </b></td><td>Flex 3</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions : </b></td><td>Flash Player 9, AIR 1.1</td></tr></table><p></p><p></p><p> |
| This method is called by the AsyncToken when it wants to deliver a |
| <code>ResultEvent</code> to the CallResponder. You do not call |
| this method directly. |
| </p><p><span class="label"> Parameters </span><table cellpadding="0" cellspacing="0" border="0"><tr><td width="20px"></td><td><code><span class="label">data</span>:Object</code> — The ResultEvent delivered by the AsyncToken |
| |
| </td></tr></table></p></div><div class="detailSectionHeader"> Event Detail </div><a name="event:fault"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">fault</td><td class="detailHeaderType"> Event </td></tr></table><div class="detailBody"><span class="label">Event Object Type: </span><a href="../../mx/rpc/events/FaultEvent.html"><code>mx.rpc.events.FaultEvent</code></a><br/><span class="label">FaultEvent.type property = </span><a href="../../mx/rpc/events/FaultEvent.html#FAULT"><code>mx.rpc.events.FaultEvent.FAULT</code></a><br/><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version : </b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version : </b></td><td>Flex 3</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions : </b></td><td>Flash Player 9, AIR 1.1</td></tr></table><p></p><p></p><p> |
| Dispatched when an Operation call fails. |
| </p> |
| The FAULT event type. |
| <p>The properties of the event object have the following values:</p> |
| <table class="innertable" ><tr><th>Property</th><th>Value</th></tr><tr><td><code>bubbles</code></td><td>false</td></tr><tr><td><code>cancelable</code></td><td>true, calling preventDefault() |
| from the associated token's responder.fault method will prevent |
| the service or operation from dispatching this event</td></tr><tr><td><code>currentTarget</code></td><td>The Object that defines the |
| event listener that handles the event. For example, if you use |
| <code>myButton.addEventListener()</code> to register an event listener, |
| myButton is the value of the <code>currentTarget</code>. </td></tr><tr><td><code>fault</code></td><td>The Fault object that contains the |
| details of what caused this event.</td></tr><tr><td><code>message</code></td><td>The Message associated with this event.</td></tr><tr><td><code>target</code></td><td>The Object that dispatched the event; |
| it is not always the Object listening for the event. |
| Use the <code>currentTarget</code> property to always access the |
| Object listening for the event.</td></tr><tr><td><code>token</code></td><td>The token that represents the call |
| to the method. Used in the asynchronous completion token pattern.</td></tr></table> |
| </div><a name="event:result"></a><table class="detailHeader" cellpadding="0" cellspacing="0"><tr><td class="detailHeaderName">result</td><td class="detailHeaderType"> Event </td><td class="detailHeaderRule"> </td></tr></table><div class="detailBody"><span class="label">Event Object Type: </span><a href="../../mx/rpc/events/ResultEvent.html"><code>mx.rpc.events.ResultEvent</code></a><br/><span class="label">ResultEvent.type property = </span><a href="../../mx/rpc/events/ResultEvent.html#RESULT"><code>mx.rpc.events.ResultEvent.RESULT</code></a><br/><p></p><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Language Version : </b></td><td>ActionScript 3.0</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Product Version : </b></td><td>Flex 3</td></tr></table><table cellpadding="0" cellspacing="0" border="0"><tr><td style="white-space:nowrap" valign="top"><b> Runtime Versions : </b></td><td>Flash Player 9, AIR 1.1</td></tr></table><p></p><p></p><p> |
| Dispatched when an Operation invocation successfully returns. |
| </p> |
| The RESULT event type. |
| <p>The properties of the event object have the following values:</p> |
| <table class="innertable" ><tr><th>Property</th><th>Value</th></tr><tr><td><code>bubbles</code></td><td>false</td></tr><tr><td><code>cancelable</code></td><td>true, preventDefault() |
| from the associated token's responder.result method will prevent |
| the service or operation from dispatching this event</td></tr><tr><td><code>currentTarget</code></td><td>The Object that defines the |
| event listener that handles the event. For example, if you use |
| <code>myButton.addEventListener()</code> to register an event listener, |
| myButton is the value of the <code>currentTarget</code>. </td></tr><tr><td><code>message</code></td><td> The Message associated with this event.</td></tr><tr><td><code>target</code></td><td>The Object that dispatched the event; |
| it is not always the Object listening for the event. |
| Use the <code>currentTarget</code> property to always access the |
| Object listening for the event.</td></tr><tr><td><code>result</code></td><td>Result that the RPC call returns.</td></tr><tr><td><code>token</code></td><td>The token that represents the indiviudal call |
| to the method. Used in the asynchronous completion token pattern.</td></tr></table> |
| |
| </div><br/><br/><hr><br/><p></p><center class="copyright"><footer>The Apache Software Foundation</footer><br/>Wed Nov 15 2017, 09:50 AM +01:00 </center></div></body></html><!--The Apache Software Foundation<br/>Wed Nov 15 2017, 09:50 AM +01:00 --> |