Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

pass Object from flex to backend

Posted on 2011-02-10
5
Medium Priority
?
433 Views
Last Modified: 2012-05-11
hi guys

I am using flex in UI with java backend (using spring blazeds integration)


In my java backend i have my

Open in new window

object as

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

<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> 
	

Open in new window


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
0
Comment
Question by:royjayd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 17

Expert Comment

by:deepanjandas
ID: 34867993
0
 

Author Comment

by:royjayd
ID: 34868074
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
0
 
LVL 17

Accepted Solution

by:
deepanjandas earned 1500 total points
ID: 34868125
I have not tried that till now..Need to test with such a scenario.

Warm Regards
Deepanjan Das
0
 

Author Closing Comment

by:royjayd
ID: 35028667
not satisfied with response
0

Featured Post

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question