File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Application Frameworks and the fly likes Javascript Variable to POJO using DWR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Javascript Variable to POJO using DWR" Watch "Javascript Variable to POJO using DWR" New topic
Author

Javascript Variable to POJO using DWR

ragha sid
Greenhorn

Joined: Dec 23, 2009
Posts: 1
Hi,

How do I send a javascript variable from my client side to the server side and use it as a java bean on the server side using DWR?

Rahgav
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You call Java methods in a way that looks just like Java--DWR creates JavaScript versions.

What specifically are you having problems with?
Raghav Sidhanti
Greenhorn

Joined: Oct 09, 2009
Posts: 3
Hi David,

Thank you. DWR works seamlessly when I send a java bean from my server side to my client side. But when I tried it the other way around it doesn't covert my javascript variable back to the java bean it originally was.

for example. I have a list of company beans that I am sending from my server side to the client side.


In my DWR class, I have two methods namely:

At the client side I call the getListOfCompanies() method (dwr style) and it will return the list as an array which I will loop through to get my companies as javascript variables.

Now, at the client side I perform some changes to these companies and add them back to an array in order to send them back to server side. However, when I call the saveListOfCompanies(List) I getting a list of java.lang.Strings on the server side and not a list of Company bean.

My question is, how do I get back my Company beans and not a String?

Hope this makes sense.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Without any code or configs I don't know how to help.
 
Consider Paul's rocket mass heater.
 
subject: Javascript Variable to POJO using DWR
 
Similar Threads
practical projects
Best Ajax Framework
Suggest script language for rules please
Reimplementing parts of my app with DWR
can we call a javaclass from a javascript function?