[Seaside] capture client events in seaside?

Nick Ager nick.ager at gmail.com
Tue Sep 13 13:32:02 UTC 2011


| selectId |

You could try something like (untested):

html select
        id: (selectId := html nextId);
list: Dao new allProducts;
selected: currentProduct;
        *callback: [ :value | currentProduct := value ];*
  onChange: (html jQuery ajax script: [ :s |
s << "render updates here"]; serialize: (html jQuery id: selectId))


On 13 September 2011 14:18, Larry White <ljw1001 at gmail.com> wrote:

> hmm. I tried your suggestion and it's almost working, but I don't see how
> to get the current selection value back.  If I replace the [do your stuff
> here] block with one that accepts an argument, like [:val | doSomethingWIth:
> val] I get an exception stating that the block wants an argument, but it's
> not being called with one.
>
> I tried to use* html select callback: *to get the selected value (this
> seems to be what the example on the Jquery/seaside web pages show), but it
> never gets invoked:
>
> html select
>  list: Dao new allProducts;
> selected: currentProduct;
>             *callback: [ :value | currentProduct := value ];*
>   onChange: (html jQuery ajax callback: [
> productEntryAction value: currentProduct]).
>
> Any other suggestions would be appreciated. Thanks again.
>
>
> On Sun, Sep 11, 2011 at 2:46 PM, Milan Mimica <milan.mimica at gmail.com>wrote:
>
>> html select list
>>  onChange: (html jQuery ajax callback: [ do your stuff here ]).
>>
>>
>> On 11 September 2011 20:39, Larry White <ljw1001 at gmail.com> wrote:
>> > Hi what is the best way to capture a client-side event in seaside?
>> > I have a menu that includes a select box. I would like to capture the
>> select
>> > event so that I can update a view when the selection changes.
>> > html select  list: (Dao new) allProducts;
>> >             callback: [ :value |
>> > productEntryAction value].
>> > I guess I could wrap it in a form and put a 'go' submitButton next to
>> it,
>> > but that seems so 2004 ;)  Is there anything better?
>> >
>> >
>> > _______________________________________________
>> > seaside mailing list
>> > seaside at lists.squeakfoundation.org
>> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>> >
>> >
>>
>>
>>
>> --
>> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110913/cce43d33/attachment.htm


More information about the seaside mailing list