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

squeakman squeakman at gmail.com
Sun Aug 19 14:06:49 UTC 2012

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,


----- start of code -----

(html textInput)
	callback: [:v | self textValue: v];
	onChange: ((html scriptaculous updater)
			id: #prices;
			triggerForm: fid;
			"Attempt to replace 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).

More information about the seaside mailing list