[Seaside] jQuery and #children

Lukas Renggli renggli at gmail.com
Wed Mar 17 08:32:56 UTC 2010

> say I have #renderContentOn: like
> something onClick: (html jQuery ajax script: [:s|
> s << (s jQuery id: 'blah') load html: [ :h | h render: (AComponent new) ]
> ]).
> what are the rules for #children/callbacks etc when it comes to rendering
> from ajax calls? should I be returning the AComponent instance from the
> #children method?

This is not necessary in this case. To return a component from the
#children is only required to enable backtracking of that components
(#states, #updateStates:), to give it the possibility to handle the
initial request (#initialRequest:), to give it the possibility to
change the head (#scripts, #styles, #updateRoot:), and to give it the
possibility to change the URL (#updateUrl:).

In your example none of these concerns actually make sense. There is
no backtracking (because each AJAX request creates a new component
each time), there is no initial request (because the AJAX request can
never come first), the head is not changed (that would require some
Javascript), and the URL is not changed (that would require some

There is the class WAPainter (a superclass of WAComponent) available
in Seaside 3 that serves exactly this purpose. If you do not need all
the functionality of WAComponent (as it seems in your case), then you
can subclass directly from there (see its class comment).

> I must add, the jQuery integration is very slick and fun to use, well done!

Thank you.


> rado
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

Lukas Renggli

More information about the seaside mailing list