[Seaside] jQuery ajax: Combining passengers with script

Martin Büttner martin.buettner at student.hpi.uni-potsdam.de
Tue Jun 22 18:34:14 UTC 2010

If I do this I cannot use the passenger in the script-generating code. 
Of course, I could save the sent passenger in an instance variable and 
use that instance variable in the script: callback. But this solution 
needs two ajax requests. I would prefer one that does it in one request.
The reason why I need the passenger when generating the script is, that 
I want to do something like "... append: (html textInput on: #... of: 
If this is the only solution, I'll stick to writing a script:passengers: 
analogous to callback:passengers.


Am 22.06.2010 19:29, schrieb Lukas Renggli:
> I would try with something along the following lines:
> html jQuery ajax
>      callback: [ :passengers | " handle your passengers " ]
>      passengers: aQueryThatSelectsSomeDomElementsWithPassengers;
>      script: [ :script | " generate some javascript code " ]
> Lukas
> On 22 June 2010 15:56, Martin Büttner
> <martin.buettner at student.hpi.uni-potsdam.de>  wrote:
>> Hi there,
>> I'm using Seaside 3.0 and jQuery UI 1.8.1 (Monticello-rev. 56;
>> jQuery-Core-rev 105).
>> What I want to do:
>> I use passengers to associate some objects on the server with my UI-elements
>> on the client. Now I want to send an ajax call to the server, sending a
>> passenger along with it. The callback shall return javascript code to be
>> executed afterwards.
>> Since there is no script:passengers: method on JQAjax, I tried some
>> combinations. One idea was to use callback:passengers: and execute the code
>> in an onSuccess: method. But the server doesn't seem to return anything
>> (although, the comment in callback: says "The primary callback must generate
>> a response").
>> Can anyone please tell me what is the best practice solution for the
>> problem. I hope there is one and I do not have to subclass JQAjax to write a
>> new script:passengers: method ;)
>> Best regards,
>> Martin Buettner
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

More information about the seaside mailing list