code_junkie

Flex: How do I access the data in my flex form and submit it to a ColdFusion cfc?

Nov 13th, 2011
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. <mx:Form x="10" y="10" width="790" id="myFrom" defaultButton="{createReport}">
  2. <mx:FormItem label="Resume Report Type:">
  3. <mx:RadioButtonGroup id="showtype"/>
  4. <mx:HBox>
  5. <mx:RadioButton groupName="showtype" id="NotUpdated" value="notupdated" label="Not Updated" width="100" />
  6. <mx:RadioButton groupName="showtype" id="Updated" value="updated" label="Updated" width="75" />
  7. <mx:RadioButton groupName="showtype" id="All" value="all" label="All" width="75" />
  8. </mx:HBox>
  9. </mx:FormItem>
  10. <mx:FormItem label="User Organzation:">
  11. <mx:ComboBox dataProvider="{qOrganization}" labelField="UserOrganization" /> </mx:FormItem>
  12.  
  13. <mx:FormItem label="Between the following dates:">
  14. <mx:HBox>
  15. <mx:DateField/>
  16. <mx:DateField left="10"/>
  17. </mx:HBox>
  18. </mx:FormItem>
  19. <mx:FormItem>
  20.  
  21. <mx:Button label="Create Report" id="createReport"/>
  22. </mx:FormItem>
  23. </mx:Form>
  24.  
  25. var obj : MyObject = new MyObject();
  26. obj.beginDate = beginDate.selectedDate;
  27. obj.endDate = endDate.selectedDate;
  28. obj.organization = Organization(comboOrg.selectedItem);
  29. // etc
  30.  
  31. <!-- DATA MODEL -->
  32. <mx:Model id="formModel">
  33. <form>
  34. <beginDate>{beginDate.selectedDate}</beginDate>
  35. <endDate>{endDate.selectedDate}</endDate>
  36. <organization>
  37. <name></name>
  38. <address></address>
  39. </organization>
  40. </form>
  41. </mx:Model>
  42.  
  43. <!-- REMOTE OBJECT/SERVER SIDE FORM HANDLER -->
  44. <mx:RemoteObject
  45. id="roSubmitForm"
  46. source="com.mycfc"
  47. destination="ColdFusion"
  48. showBusyCursor="true">
  49.  
  50. <mx:method name="submitForm" result="onSubmit(event)">
  51. <mx:arguments>
  52. <form>
  53. <beginDate>{formModel.beginDate}</beginDate>
  54. <endDate>{formModel.endDate}</endDate>
  55. <organization>
  56. <name>formModel.organization.name</name>
  57. <address>formModel.organization.address</address>
  58. </organization>
  59. </form>
  60. </mx:arguments>
  61. </mx:method>
  62. </mx:RemoteObject>
Add Comment
Please, Sign In to add comment