[Seaside] JQuery updating DOM elements

John Toohey johnptoohey at gmail.com
Wed Feb 11 19:22:09 UTC 2009


Changed the code to this, and now it works :-
html span class: 'formdata'; with: [html
textInput
id: #tournamentname;
value: 'DefaultName';
value: tournamentEvent tournamentName;
callback: [:value | tournamentEvent tournamentName: value];
onChange:(html jQuery ajax script: [ :s | s << (s jQuery: #potsize) value:
999])
].

If I understand this correctly, this is quite powerful. Is s a stream that
is opened back to the browser?


On Wed, Feb 11, 2009 at 1:56 PM, John Toohey <johnptoohey at gmail.com> wrote:

> Changed the code to this :- html span class: 'formdata'; with: [html
> textInput
>  id: #tournamentname;
> value: tournamentEvent tournamentName;
> callback: [:value | tournamentEvent tournamentName: value];
>  onChange: ((html jQuery: #potsize) load html: [:h | h render: 999 ])].
>
> Now I'm just trying to change the default value of #potsize to 999, and I
> can see the initial request being sent to the server, but nothing is updated
> on the client.
>
> I tried to load the Slime package from your site, but received a lot of
> errors from my Pharo image. I can run the Slime tests that are included with
> Seaside 2.9 successfully, but can't see how to run Slime on my own code.
>
> Any help is really appreciated.
>
> Thanks.
>
> On Tue, Feb 10, 2009 at 4:09 PM, Lukas Renggli <renggli at gmail.com> wrote:
>
>> > - 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
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>
>
>
> --
> -JT
>
>
>


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


More information about the seaside mailing list