« Return to Thread: Accessing SURequest / SUAjax post parameters

Re: Accessing SURequest / SUAjax post parameters

by Edward Stow :: Rate this Message:

Reply to Author | View in Thread

On Tue, Apr 15, 2008 at 9:25 AM, Edward Stow <ed.stow@...> wrote:

> On Tue, Apr 15, 2008 at 8:57 AM, Lukas Renggli <renggli@...> wrote:
>
>  >
>  >  Try this:
>  >
>  >
>  >  >         html anchor
>  >  >                 onClick:  (html request
>  >  >                         callback: [ self updateModel: testParamValue ];
>  >  >                         callback: [ :value | testParamValue := value ] value: 'abc');
>  >  >                 with: 'SURequest example'
>  >
>
>  I think a little more explanation of my scenario is needed:  I have a
>  client side javascript application -- a google maps mashup with a
>  number of overlays, that is manipulated entirely within the browser.
>  The browser model can be serialized in json format with a function
>  call eg:
>
>  myModel.toJson()  -- so what I want to end up with is a callback that
>  returns the json data to my Seaside component.
>
>  The basic questions is how to construct a the requests so to call some
>  function eg toJson() in the browser and return the string generated by
>  the function.

I have been hacking around (in the pejorative sense) with
WACallbackStream -- this works but is clearly not at all elegant.

MyComponent>>processCallbackStream: aCallbackStream
        aCallbackStream request fields
                at: 'testParam' ifPresent: [:testParam | self updateModel: testParam ].
        super processCallbackStream: aCallbackStream

And in
WACallbackStream>>request
       ^request

--

Edward Stow
_______________________________________________
seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

 « Return to Thread: Accessing SURequest / SUAjax post parameters

LightInTheBox - Buy quality products at wholesale price