extend client side java bean

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

extend client side java bean

maik huber
I am not sure how to deal with the following:

I have a JavaBean on the server which I convert to a Javascript Object
on the Client using DWR.
On the Client I extend the JS-Object with additional methods and
properties. These fields are only needed on the client side.
Now when I send the Object backt to the Server I get this warning:
"Missing java bean property to match javascript property"

How can I suppress this warning or how do I correctly extend a JavaBean
on the client that can be sent back to the server without generating
this warning?

Thank you!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: extend client side java bean

david@butterdev.com
1) Mike's replies here should help (use class mapping):
http://dwr.2114559.n2.nabble.com/read-only-properties-tt2418009.html#a2425036

Or ...

2) Remove the client side properties before sending the object.

On 12/28/2011 12:48 AM, [hidden email] wrote:

> I am not sure how to deal with the following:
>
> I have a JavaBean on the server which I convert to a Javascript Object
> on the Client using DWR.
> On the Client I extend the JS-Object with additional methods and
> properties. These fields are only needed on the client side.
> Now when I send the Object backt to the Server I get this warning:
> "Missing java bean property to match javascript property"
>
> How can I suppress this warning or how do I correctly extend a JavaBean
> on the client that can be sent back to the server without generating
> this warning?
>
> Thank you!
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: extend client side java bean

Mike Wilson
Administrator
Adding to David's post, since 3.0 RC2 there's actually a third
"undocumented" alternative that may come in handy if you are
adding the same properties to a lot of different kinds of objects:

3) dwr.engine._excludeObjectAttributes.myprop = true

The above will ignore the "myprop" attribute in *all* objects
sent to the server.

Best regards
Mike Wilson

David Marginian wrote:

> 1) Mike's replies here should help (use class mapping):
> http://dwr.2114559.n2.nabble.com/read-only-properties-tt241800
> 9.html#a2425036
>
> Or ...
>
> 2) Remove the client side properties before sending the object.
>
> On 12/28/2011 12:48 AM, [hidden email] wrote:
> > I am not sure how to deal with the following:
> >
> > I have a JavaBean on the server which I convert to a
> Javascript Object
> > on the Client using DWR.
> > On the Client I extend the JS-Object with additional methods and
> > properties. These fields are only needed on the client side.
> > Now when I send the Object backt to the Server I get this warning:
> > "Missing java bean property to match javascript property"
> >
> > How can I suppress this warning or how do I correctly
> extend a JavaBean
> > on the client that can be sent back to the server without generating
> > this warning?
> >
> > Thank you!
> >
>

Loading...