Passing a complex object as a parameter

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Passing a complex object as a parameter

mov2k6
Hello everyone !

First of all, let me apologize for posting something that might be already answered, but the response for a similar post that I found was : "you will find your answer here : <link>". The problem is that the link was invalid (I am at work right now, and maybe this is the reason). Anyway ...

I have a Java method called, let's say, 'myMethod(MyClass myParameter)', inside a service. The 'MyClass' class has many attributes, like, strings, lists, etc. and is acts as a filter, in my application.

This method uses the parameter to filter stuff. In case of a parameter with no specifications, it returns everything.

I am trying to call this method, from Javascript, and specify some fields. The problem is that I get everything, every time. My question is : How do you specify a complex parameter, like this, in Javascript ?

Details :
- I placed a converter for MyClass inside dwr.xml
- let's assume MyClass has the following attributes : String stringField; List<String> stringListField, Date dateField

Thank you very much for everything that you do ! :D
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Passing a complex object as a parameter

david@butterdev.com
This is covered in the documentation:
 
See "Creating JavaScript objects to match Java objects"

On Mon, Jan 16, 2012 at 3:12 AM, mov2k6 <[hidden email]> wrote:
Hello everyone !

First of all, let me apologize for posting something that might be already
answered, but the response for a similar post that I found was : "you will
find your answer here : <link>". The problem is that the link was invalid (I
am at work right now, and maybe this is the reason). Anyway ...

I have a Java method called, let's say, 'myMethod(MyClass myParameter)',
inside a service. The 'MyClass' class has many attributes, like, strings,
lists, etc. and is acts as a filter, in my application.

This method uses the parameter to filter stuff. In case of a parameter with
no specifications, it returns everything.

I am trying to call this method, from Javascript, and specify some fields.
The problem is that I get everything, every time. My question is : How do
you specify a complex parameter, like this, in Javascript ?

Details :
- I placed a converter for MyClass inside dwr.xml
- let's assume MyClass has the following attributes : String stringField;
List<String> stringListField, Date dateField

Thank you very much for everything that you do ! :D

--
View this message in context: http://dwr.2114559.n2.nabble.com/Passing-a-complex-object-as-a-parameter-tp7192011p7192011.html
Sent from the DWR - Users mailing list archive at Nabble.com.

Loading...