[Seaside] client side programming

Johan Brichau johan at inceptive.be
Mon Sep 12 11:23:44 UTC 2011


Hi,

When we want to use a Seaside callback in the place of a Javascript callback in external Javascript code, we frequently do this:
- Generate a named Javascript function definition from within Seaside.
- Use the named Javascript function as a callback in the external Javascript code.

For example, the following code generates a one-argument Javascript function that, when called, will do the callback

	html document addLoadScript:  ((html jQuery ajax 
									callback:[:val | … ] 
									value: (JSStream on: 'argument')) asFunction:#(argument)) assignTo: 'callbackFunction)

Then use 'callbackFunction' in your external javascript. E.g.:

$('.callbacked').selectable({onSelect:callbackFunction})


It probably makes sense to come up with a good abstraction for this kind of interactions in Seaside. We should think about it…

Johan

On 11 Sep 2011, at 18:14, Robert Sirois wrote:

> data do: [:t |
> 	html document addLoadScript: ((html jQuery: t title asSymbol) live: 'click' do: ((html jQuery ajax callback: [ ... ]) onComplete: html javascript refresh)).
> ].
> 
> RS
> 
> > Date: Sun, 11 Sep 2011 18:10:42 +0200
> > Subject: Re: [Seaside] client side programming
> > From: milan.mimica at gmail.com
> > To: seaside at lists.squeakfoundation.org
> > 
> > Sorry, I didn't understand that. Could you elaborate please?
> > 
> > On 11 September 2011 18:08, Robert Sirois <watchlala at hotmail.com> wrote:
> > > Binding click events after the fact :/
> > > RS
> > >
> > 
> > 
> > 
> > 
> > -- 
> > Milan Mimica
> > http://sparklet.sf.net
> > _______________________________________________
> > seaside mailing list
> > seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list