[Seaside] JQuery updating DOM elements

Lukas Renggli renggli at gmail.com
Tue Feb 10 21:09:43 UTC 2009


> - How do I use Slime with my Code? Using the latest Pharo image, and have
> found the Slime classes, but not sure how to use them.

http://www.lukas-renggli.ch/blog/slime

> - Tried this :-
> html span class: 'formdata'; with: [html
> textInput
> id: #tournamentname;
> value: tournamentEvent tournamentName;
> callback: [:value | tournamentEvent tournamentName: value];
> onChange: (html jQuery ajax serializeThis; html: [:r | r render: [self test:
> 1 on:  r]] )].

You need to specify somewhere what element to change, right?

- You can either do that by sending back a javascript that does the
update of the particular element. In this case you would replace
"html: [ :r | .. ]" with something like "script: [ :s | s << (s
jQuery: '.someid') html: DateAndTime now ]". This is very powerful,
but also a bit complicated.

- Or (and this is probably what you want) you can use the ajax-loader
on the particular DOM node. So just replace "html jQuery ajax" with
"(html jQuery: '.someid') load".

Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the seaside mailing list