[Seaside] jQuery methods on WARenderer

Julian Fitzell jfitzell at gmail.com
Mon Aug 16 12:12:45 UTC 2010

Hi Ben,

Anything creating a callback (which #ajax: certainly does) requires
access to the renderer (actually it requires access only to the
rendering context, but the distinction isn't helpful in this case).


On Sat, Aug 14, 2010 at 3:35 PM, Ben Corne <ben.corne at gmail.com> wrote:
> Hello,
> From what I've experienced so far, each time you want to insert some
> javascript code for instance via the jQuery integration, you need to start
> from html and then you stop using the html renderer further down the path.
> This bothers me because each time you want to split functionality up in
> methods you always have to pass the html method towards the more specific
> methods as an argument.
> for instance:
> Test>>renderContentOn: html
>   html div style='width:200px;height:200px;';
>      onClick: (html jQuery ajax
>         callback: [Transcript show: 'hi'])
> If I were to abstract the onClick method to "sayHi" I'd have to pass the
> renderer as a parameter:
> Test>>renderContentOn: html
>   html div style='width:200px;height:200px;';
>      onClick: (self sayHiOn: html)
> Test>>sayHiOn: html
>   ^html jQuery ajax callback: [Transcript show: 'hi']
> now what I'd like to propose / wonder if it exists is:
> Test>>renderContentOn: html
>   html div style='width:200px;height:200px;';
>      onClick: (self sayHi).
> Test>>sayHi
>   ^self javascript jQuery ajax: [Transcript show: 'hi'].
> to remove the obligatory, unused renderer parameter
> Even if there are cases where your renderer needs to be there, which I
> haven't encountered yet, a version where you don't need to pass it along
> would be handy.
> The use of the renderer is to write requested elements to it right?
> But when generating jQuery javascript all you do is return the text and not
> write it straight to it, to allow concatinating javascript code.
> Well that's about it on the obligatory renderer.
> If it'd ever get through, perhaps also think of expanding WAComponent with
> the 'with' methods like for an Array.
> WAComponent>>jsWith:
> WAComponent>>jsWith: with:
> WAComponent>>jsWith: with: with: ... and so on
> This is to prevent a small confusion which I had when I wondered how I could
> do more jQuery commands in one event, until I figured out it was possibly
> simply by concatenating.
> Greets, Ben
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

More information about the seaside mailing list