[Seaside] Seaside sessions and ajax

sig siguctua at gmail.com
Sun May 20 20:35:04 UTC 2007

On 18/05/07, Lukas Renggli <renggli at gmail.com> wrote:
> > so, i can add #onFailure: handler for my updater ?
> Yes, that's the idea.
> > can you please point to small code snippet using this.
> You can find the full documentation here:
>         http://www.prototypejs.org/api/ajax/options
> For example the counter application could be modified to look like:
>         html anchor
>                 onClick: (html updater
>                         id: id;
>                         onFailure: (SUScript new alert: 'Ouch, the session is gone');
>                         callback: [ :render | self increase; renderCountOn: render ]);
>                 with: '++'.
> > Im asking
> > because its pretty hard to express some meaningfull javascript
> > statements with current SUScript interface.
> > For example, for generating a simple javascript
> > if (...) { statements}  statements
> > i have a following horror code in smalltalk:
> Yes, that looks ugly. I have problems to understand, but I suspect ...
> > I think this must be changed to more convenient form for generating a
> > scripts by server.
> Scriptaculous is not ment for that, but to interface with existing
> Javascript code. I suggest that you write your functionality in an
> external file and call it from the Scriptaculous tools. They are
> designed to do that, not to write whole scripts.
Well, i tried to add script,
but its simply don't rendered by updater, and i didn't find a way how.
Of course i can put just:  html tag:'script' -- but this is even
uglier than example above.
I tried to add html script: ...  to the end of updated part of page.
But then i see that
a #script: doing not exactly what i wanted. Instead of placing it in
HTML code at place where i said, it adds this script to the collection
which then will appear in HEAD tag.

> > And if you know how, please tell me how i can set a default OnFailure
> > handler in ajax, because putting onFailure: everywhere is too
> > excessive.
> You can set that on a per-handler bases, but pleas study the Protoypes
> and script.aculo.us documentation for the details.
Thanks for link with docs. I will study it to find possible solution.


More information about the seaside mailing list