[Seaside] Seaside + Comet

Lukas Renggli renggli at gmail.com
Fri Jan 19 21:44:23 UTC 2007

> I`m a newbie with seaside and comet. After loading successfully
> SeasideComent on VW, I looked at the examples of Comet.
> In the counter example we can see these code:
>         pusher javascript: (SUElement new
>                 id: 'count';
>                 update: self count contents asString)
> The update method receives a string to be updated in the page. I`m
> trying to reproduce the renderOn: behaviour of a SUComponent so that
> the string to be pushed is a result of the rendering process.

SUElement has that already. Try something like:

pusher javascript: (html element
     id: 'count';
     render: [ :r | r anchor callback: [ ... ]; with: ... ])

> The problem is that the updater is not working after the re-rendering.
> I supposed that the problem is with the push-like code. Is there a
> solution for using comet and the renderOn: transparently?

I don't exactly understand what you are trying to do. If you push code
containing callbacks, then all the connected sessions will receive
exactly the same string. This means all the callbacks will point (and
be evaluated) in the session that did the rendering. Moreover people
will be able to hijack the initiating session, as you just hand out
your private key to everybody. I don't think you want that, but
unfortunately this cannot be avoided easily.

What I suggest you to do is to just trigger an event handler in all
your clients so that they can make an update request on their specific

Was this what you wanted to do?


Lukas Renggli

More information about the Seaside mailing list