According to Ben Forta this is what I need.
1) Create a ColdFusion CFC method which accepts a record to insert,
either a struct with properties or just a list of arguments.
DONE
2) Define a <mx:RemoteObject> connection to the CFC.
DONE
3) Create your form in Flex. The click event on the form button
calls an AS function.
FORM LAYOUT DONE, but not AS.
4) That AS function does any validation, and then calls cfcObj.method
() passing it an equivalent AS class or the values comma delimited.
What I still need help with is the AS to tie the onclick in the
button, to an AS function, then passing the form data to the
remoteobject.
Probably pretty easy AS, but I'm just trying to learn AS.
Conceptually, the process is clear, but I need to see a generic
example of the syntax. Here is portions of the code so far:
<mx:Script>
function sendFormdata(){
???????
}
</mx:Script>
<mx:RemoteObject
id="cfdataInsert" showBusyCursor="true"
destination="ColdFusion"
source="da8.Constellation.entries">
<mx:method name="createEntry" result="createEntry_result(event)" />
????
</mx:RemoteObject>
<mx:FormItem label="Name" id="FI_Name" required="true"
horizontalAlign="left">
<mx:TextInput id="Name" editable="true" enabled="true" width="300"/>
</mx:FormItem>
<mx:FormItem label="email" id="FI_email" required="true">
<mx:TextInput id="Form_email" width="300"/>
</mx:FormItem>
<mx:FormItem id="FI_BTN_send">
<mx:Button label="Send" id="BTN_Send" click="sendFormdata()"
enabled="true" labelPlacement="right"/>
</mx:FormItem>
I'd appreciate any help pulling these three parts together.
Thanks,
Don
--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]>
wrote:
>
> A Flex "form" is just a layout container. There is no built-
in "submit"
> functionality. There is no "submit button".
>
>
>
> You will need to use one of the RPC data services to send your
data to
> the server.
>
>
>
> Also be aware that two-way binding is not automatic. Modifying a
form
> field does not automatically update the dataProvider. You will
need to
> set this up if you want it.
>
>
>
> Tracy
>
>
>
> ________________________________
>
> From: [email protected]
[mailto:[EMAIL PROTECTED] On
> Behalf Of nasawebguy
> Sent: Sunday, March 04, 2007 12:19 PM
> To: [email protected]
> Subject: [flexcoders] Simple form submit example
>
>
>
> I need basic example code for a simple form submit.
> I'm using a flex form
> and have a ColdFusion CFC to do the insert.
>
> What I need is what gets the two talking?
>
> I'm not using FDS at this point. Just ColdFusion MX7.02.
>
> I assume I should use a remoteobject, but I don't know how to pass
> the flex form data to it when the user click submit.
>
> What goes in the onclick on the submit button?
> What AS do I need to pass the form data to the remoteobject?
> What should the remoteobject look like to pass the data to the CFC?
>
> I'm just learning flex, but I'm used to ColdFusion flash forms
using
> cfinvoke arguments. I assume it is done using remoteobject instead
> of cfinvoke. But I'm open to the easiest way to do it.
>
> Thanks,
> Don
>