[Seaside] Re: How to change callback for html select on the fly

squeakman squeakman at gmail.com
Mon Aug 20 13:06:46 UTC 2012


On 19/08/2012 1:13 PM, Bob Arning wrote:
> I think this does what you were looking for. I got stymied for a while
> hitting return after changing the value in the text field. This caused a
> complete redraw and did not activate the updater callback. If I hit tab
> instead of return, things started working. FYI.
>
> Cheers,
> Bob
>
> renderContentOnSqueakman1: html
>
>      | fid mid saveText |
>
>      fid _ html nextId.
>      mid _ html nextId.
>      html form
>          id: fid;
>          with: [
>              (html textInput)
>                  value: 'initial';
>                  callback: [:v | saveText _ v];
>                  onChange: ((html scriptaculous updater)
>                          id: mid;
>                          triggerForm: fid;
>                          callback: [:r |
>                                  self renderTheListWith: saveText
> asArray on: r
>                      ]
>                  ).
>              html div
>                  id: mid;
>                  with: [
>                      self renderTheListWith: #(30 50 60) on: html
>                  ]
>          ].
>
> renderTheListWith: data on: html
>
>      html text: 'Choose Amount'.
>      html select
>              callback: [:v | self amount: v];
>              list: data.
>
>

That worked perfectly.  It took me a while to realise it because I was 
down a rabbit hole fiddling with Javascript.

Thanks Bob and Robert for the help.  Much appreciated.

Frank






More information about the seaside mailing list