Customising protocol

View: New views
4 Messages — Rating Filter:   Alert me  

Customising protocol

by Hani Suleiman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Where should I start looking if I want to 'enhance' the dwr wire  
protocol?

What I'd like to do add support for dot notation properties.

So for example, for this request:

c0-id=0
c0-e1=string: 999
c0-param0=Object_Object:{myobj.id:reference:c0-e1}

I'd like dwr assume that this is a nested object called 'myobj',  
instantiate it for me, then call setId() on it. The exacly same  
behaviour as it'd have if it were a 'normal' nested reference in  
dwr's protocol.

Is this doable?

Of course, this would all be unnnessary if dwr's json support is  
showing up anytime soon. Any ETA/progress on that?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: Customising protocol

by Joe Walker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Can you no do this already by passing in a Javascript object containing another Javascript object?

Remote.method({ myobj:{ id:"999" } }, callback);

Joe.

On 8/19/07, Hani Suleiman <hani@...> wrote:
Where should I start looking if I want to 'enhance' the dwr wire
protocol?

What I'd like to do add support for dot notation properties.

So for example, for this request:

c0-id=0
c0-e1=string: 999
c0-param0=Object_Object:{myobj.id:reference:c0-e1}

I'd like dwr assume that this is a nested object called 'myobj',
instantiate it for me, then call setId() on it. The exacly same
behaviour as it'd have if it were a 'normal' nested reference in
dwr's protocol.

Is this doable?

Of course, this would all be unnnessary if dwr's json support is
showing up anytime soon. Any ETA/progress on that?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...



Re: Customising protocol

by Hani Suleiman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

yes, that'd work. The problem I'm having is that my form 'flattens'  
the objects, and ends up with dot notation for field names.

On Aug 20, 2007, at 9:50 AM, Joe Walker wrote:

>
> Can you no do this already by passing in a Javascript object  
> containing another Javascript object?
>
> Remote.method({ myobj:{ id:"999" } }, callback);
>
> Joe.
>
> On 8/19/07, Hani Suleiman <hani@...> wrote: Where should  
> I start looking if I want to 'enhance' the dwr wire
> protocol?
>
> What I'd like to do add support for dot notation properties.
>
> So for example, for this request:
>
> c0-id=0
> c0-e1=string: 999
> c0-param0=Object_Object:{myobj.id:reference:c0-e1}
>
> I'd like dwr assume that this is a nested object called 'myobj',
> instantiate it for me, then call setId() on it. The exacly same
> behaviour as it'd have if it were a 'normal' nested reference in
> dwr's protocol.
>
> Is this doable?
>
> Of course, this would all be unnnessary if dwr's json support is
> showing up anytime soon. Any ETA/progress on that?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@...
> For additional commands, e-mail: dev-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


RE: Customising protocol

by mikewse :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> yes, that'd work. The problem I'm having is that my form 'flattens'  
> the objects, and ends up with dot notation for field names.

The natural thing would be to convert this to the correct object
structure *before* you send it away with DWR. You can write a little
JavaScript function that iterates over all form.elements and create
an appropriate object structure.

Or if you already know what attribute names are in the structure
you can create an "empty" object structure and then supply it to
dwr.util.getValues() to have it filled in with the data.

Best regards
Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...