Advertisement
murp

Flex Error Message TitleWindow

Jun 3rd, 2013
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
  3. xmlns:s="library://ns.adobe.com/flex/spark"
  4. xmlns:mx="library://ns.adobe.com/flex/mx" width="600" height="200"
  5. title="Error Message Box"
  6. close="titlewindow1_closeHandler(event)"
  7. creationComplete="{cfservice.getHost()}">
  8. <fx:Declarations>
  9. <!-- Place non-visual elements (e.g., services, value objects) here -->
  10. <s:RemoteObject destination="ColdFusion" source="facade.model.utility.hostUtility" id="cfservice" endpoint="http://lc.mat.state.gov/flex2gateway/" showBusyCursor="true">
  11. <s:method name="getHost" fault="handleFault(event)" result="handleResult(event)" />
  12. </s:RemoteObject>
  13. </fx:Declarations>
  14. <fx:Script>
  15. <![CDATA[
  16. import mx.controls.Alert;
  17. import mx.events.CloseEvent;
  18. import mx.managers.PopUpManager;
  19. import mx.rpc.events.ResultEvent;
  20.  
  21. //Alert.show('Hello');
  22. var myString:String;
  23.  
  24.  
  25. protected function titlewindow1_closeHandler(event:CloseEvent):void
  26. {
  27. PopUpManager.removePopUp( this );
  28. }
  29. private function getURL(url:String):void {
  30. var request:URLRequest;
  31. request = new URLRequest(url);
  32. navigateToURL(request, '_self');
  33. }
  34. protected function handleFault(evt):void {
  35. mx.controls.Alert.show(evt.fault.faultString);
  36. }
  37.  
  38. public function handleResult(evt:ResultEvent):void {
  39.  
  40. myString:String = evt.result.toString();
  41. //Alert.show(myString);
  42. }
  43.  
  44.  
  45. ]]>
  46. </fx:Script>
  47.  
  48. <!--<s:TextArea width="100%" height="65%" id="message"/>-->
  49. <s:VGroup x="24" y="38" width="448" height="300">
  50. <s:Label id="message" width="558" height="79"/>
  51. <mx:Button id="errBtn" label="Click to recover Session"
  52. click="getURL(myString);"/>
  53. </s:VGroup>
  54. </s:TitleWindow>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement