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

Bob Arning arning315 at comcast.net
Sun Aug 19 14:24:11 UTC 2012


Why not just make the original callback sufficiently generic that it can 
cope with the change?

html text: 'Choose Amount'.
         (html select)
         id: #prices;
         callback: [:v | self doWhateverIsImportantNowWith: v];
         list: #(30 50 60).

Cheers,
Bob

On 8/19/12 10:06 AM, squeakman wrote:
> Greetings List,
>
> I have a form with a text field and an html select with a list of 
> choices.
>
> When the user exits the text field (onChange) I want to change the 
> list of choices for the dropdown list.
>
> I can get the contents of the dropdown list to change but I cannot 
> determine how to change the associated callback.
>
> Is there a way to replace not only the contents of the dropdown list 
> but also its callback?
>
> Below is an extract of the code to show what I am trying to do.
>
> Thanks for any help you can provide,
>
> Frank
>
>
> ----- start of code -----
>
> (html textInput)
>     callback: [:v | self textValue: v];
>     onChange: ((html scriptaculous updater)
>             id: #prices;
>             triggerForm: fid;
>             "Attempt to replace callback"
>             callback:
>                 [:r |
>                     (r select)
>                     callback: [:v | self amount: v];
>                     list: #(15 25)].
>
> " The dropdown list"
> html text: 'Choose Amount'.
>         (html select)
>         id: #prices;
>         callback: [:v | self amount: v];
>         list: #(30 50 60).
>
> _______________________________________________
> 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/20120819/c54cfa0b/attachment.htm


More information about the seaside mailing list