[Seaside] jQuery methods on WARenderer

Ben Corne ben.corne at gmail.com
Sat Aug 14 14:35:24 UTC 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100814/b410b7ad/attachment.htm


More information about the seaside mailing list