Jay Roy
asked on
pass Object from flex to backend
hi guys
I am using flex in UI with java backend (using spring blazeds integration)
In my java backend i have my
Public class Person extends Base
{
string personrace;
string personage;
String email;
set();
get();
}
Public class Base{
String id;
String name;
set();
get();
}
basically its a person object with person related fields.
Now in my mxml i want to perform a save operation.
how do i go about it ?
this is what i have so far
PersonService is my service class on the spring side. but how do i pass the person object from the above mxml code to my personService.save method?
Do i write an equavalant Person.as file with all the fields like Person.java ? , not sure
thanks
I am using flex in UI with java backend (using spring blazeds integration)
In my java backend i have my
object asPublic class Person extends Base
{
string personrace;
string personage;
String email;
set();
get();
}
Public class Base{
String id;
String name;
set();
get();
}
basically its a person object with person related fields.
Now in my mxml i want to perform a save operation.
how do i go about it ?
this is what i have so far
<fx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
protected function button1_clickHandler():void
{
personService.save(PERSON OBJECT); //i want to pass the Person object here
}
]]>
</fx:Script>
<fx:Declarations>
<s:CallResponder id="loadProjectResult"/>
<services:PersonService id="personService">
<!-- Place non-visual elements here -->
<services:channelSet>
<!--connect to backend using channel -->
<s:ChannelSet>
<s:AMFChannel uri="http://localhost:9080/userweb/messagebroker/amf"/>
</s:ChannelSet>
</services:channelSet>
</services:PersonService>
</fx:Declarations>
<mx:Form x="22" y="10" width="300">
<mx:FormItem>
<s:Label text="Person name" />
<s:TextInput id="personname"/>
</mx:FormItem>
<mx:FormItem>
<s:Label text="Person id"/>
<s:TextInput id="id"/>
</mx:FormItem>
<mx:FormItem>
<s:Label text="Email Address" />
<s:TextInput id="email"/>
</mx:FormItem>
<s:Button label="Submit" click="button1_clickHandler()"/>
</mx:Form>
PersonService is my service class on the spring side. but how do i pass the person object from the above mxml code to my personService.save method?
Do i write an equavalant Person.as file with all the fields like Person.java ? , not sure
thanks
A good example is also available here:
http://sherifabdou.com/2008/06/understanding-the-remoteclass-metadata-and-its-use-in-flex-and-coldfusion/
Warm Regards
Deepanjan Das
http://sherifabdou.com/2008/06/understanding-the-remoteclass-metadata-and-its-use-in-flex-and-coldfusion/
Warm Regards
Deepanjan Das
ASKER
i am using java in my backend.My class structure is like this
Public class Person extends Base
{
string personrace;
string personage;
String email;
}
Public class Base{
String id;
String name;
}
So can i create only a single class called Person.as which contains all the 5 fields like this ?
[RemoteClass(alias="myapp. Person")] --Person.java class
[Bindable]
public final class Person
{
public var id:String;
public var name:String;
public var personrace:String;
public var personage:String;
public var email:String;
}
thanks
Public class Person extends Base
{
string personrace;
string personage;
String email;
}
Public class Base{
String id;
String name;
}
So can i create only a single class called Person.as which contains all the 5 fields like this ?
[RemoteClass(alias="myapp.
[Bindable]
public final class Person
{
public var id:String;
public var name:String;
public var personrace:String;
public var personage:String;
public var email:String;
}
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
not satisfied with response
http://livedocs.adobe.com/flex/3/html/help.html?content=metadata_3.html
http://stackoverflow.com/questions/1671668/how-does-remoteclass-work-in-flex-actionscript-can-i-use-it-for-custom-data-bin
https://www.experts-exchange.com/questions/23363839/Concept-of-RemoteClass.html
Warm Regards
Deepanjan Das