[Seaside] JQuery updating DOM elements

John Toohey johnptoohey at gmail.com
Tue Feb 10 20:48:36 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.
- 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]] )].

but cannot see any changes to the DOM element.

Thanks for looking at this for me.


On Tue, Feb 10, 2009 at 3:18 PM, Lukas Renggli <renggli at gmail.com> wrote:

> > html span class: 'formdata'; with: [html
> > textInput
> > id: #tournamentname;
> > value: tournamentEvent tournamentName;
> > callback: [:value | tournamentEvent tournamentName: value. self test:
> value
> > on: html];
> > onChange: (html jQuery ajax serializeThis)].
>
> html is not valid in the context of a callback. When the callback is
> evaluated the response connected to the html canvas you are referring
> to has already been sent to the client. Slime would detect such
> mistakes.
>
> > #potsize is the id: of another field in the dialog. My callback works,
> but
> > the DOM is not updated. What is the correct way to update other DOM
> elements
> > in this fashion?
>
> Try something along:
>
>    onChange: (html jQuery ajax
>        serializeThis;
>        html: [ :r |
>           " gee, we have a new renderer "
>           r render: DateAndTime now ])
>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>



-- 
-JT
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20090210/a917d343/attachment.htm


More information about the seaside mailing list