[Seaside] Little help for callback: value:

Gerhard Obermann obi068 at gmail.com
Tue Feb 9 12:45:48 UTC 2010


Try

value: (SUStream on: 'alert("test")')

Gerhard

On Tue, Feb 9, 2010 at 12:31 PM, Marco D'Ambros <marco.dambros at usi.ch>wrote:

> Ok, thanks.
> Now, considering the following code snippet:
>
> (html submitButton)
>        onClick: ((html evaluator)
>                callback: [:value | self halt.]
>                value: 'alert(''test'');');
>        text: 'Submit'
>
> if I understood correctly, when the button is pressed the javascript is
> executed and the result of the execution is sent back to the callback block.
> However, when I click the button the javascript is not executed, as the
> Alert('test') does not appear.
>
> Cheers,
> Marco
>
>
>
> On Feb 9, 2010, at 12:17 PM, Lukas Renggli wrote:
>
> >> I am trying to use
> >>
> >> SUEvaluator >> callback: value:
> >>
> >> to do it. The idea was to put the evaluation of the javascript command
> in the value part and pass its result to the callback. However, I am not
> sure whether this is the right way to go..
> >> Could you give me some suggestion on how to implement this?
> >
> > That's definitely the right way. You need to consider that the
> > Javascript code that is used to calculate the value should be a
> > string, because it will be put into the request URL of the evaluator.
> > Have a look at the senders of #callback:value: there are several
> > examples where values are concatenated in Javascript and split again
> > in Smalltalk.
> >
> > 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
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100209/19bf139b/attachment.htm


More information about the seaside mailing list