Just as you can use events to connect application functionality, you can also use them to handle errors. Flex data services contain a fault event that is triggered when a data service has a problem returning result data. You can write an ActionScript event handler function that responds to fault events. The following example shows how you specify a fault event handler for a web service operation:
<mx:Script>
<![CDATA[
function showErrorDialog(error){
// Function implementation...
}
]]>
</mx:Script>
...
<mx:WebService id="WeatherService" ...">
<mx:operation name="getFoo" fault="showErrorDialog(event.faultString);"/>
</mx:WebService>
Version 1.5
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flex/15/flex_docs_en/00000066.htm
Comments
chazter said on Jul 21, 2005 at 2:54 AM :