Hi,
You'd use a function to send the relevant fields back to the server where it's handled.
here's an example:
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
private function insertRecord(event:MouseEvent):void
{
ro.InsertRecord
(someValue.text,
someMore.text,
bitMore.text);
Alert.show('You have successfully added this record.');
}
private function myFaultHandler(event:FaultEvent):void
{
Alert.show(event.fault.faultString, event.fault.faultCode);
}
private function myResultHandler(event:ResultEvent):void
{
//whatever result you want in here....
}
]]>
</mx:Script>
<mx:RemoteObject id="ro" destination="ColdFusion" source="flex3.myCFC" showBusyCursor="true" >
<mx:method name="InsertRecord" result="myResultHandler(event)" fault="myFaultHandler(event)" />
</mx:RemoteObject>
<mx:HBox width="392" height="113">
<mx:VBox width="100" height="100" horizontalAlign="right">
<mx:Label text="Some data"/>
<mx:Label text="some more data"/>
<mx:Label text="bit more data"/>
</mx:VBox>
<mx:VBox width="259" height="100">
<mx:TextInput id="someValue"/>
<mx:TextInput id="someMore"/>
<mx:TextInput id="bitMore"/>
</mx:VBox>
</mx:HBox>
<mx:Button label="Add record" click="insertRecord(event)"/>
</mx:Application>
That's just a basic app, you'd then handle the data on the server, this example is using ColdFusion, but all you have to change is the Remote Object or change it to a http request.
If you were using CF to handle the data it would go something like this:
Code:
<cffunction name="InsertRecord" access="remote" returntype="Any">
<cfargument name="someValue" type="string" required="yes">
<cfargument name="someMore" type="string" required="yes">
<cfargument name="bitMore" type="string" required="yes">
<cfquery name="qInsert" datasource="#myDSN#">
INSERT INTO #myTable# (column1,
column2,
column3)
VALUES (
'#arguments.someValue#',
'#arguments.someMore#',
'#arguments.bitMore#')
</cfquery>
</cffunction>
That would obvioulsy be in your CFC.
Anyway, hope this sheds some light on the subject for you