[Seaside] Re: Seaside Digest, Vol 30, Issue 18

Yar Hwee Boon hboon at motionobj.com
Tue Jun 14 13:14:06 CEST 2005


On 14-Jun-05, at PM 06:19, Jan B. Krejčí wrote:

> Hi,
>
> I have similar question: I've got a select box and I want to update
> contents of one textInput when selection is made (like in usual file
> choosers). I think it is sufficient to use JavaScript to fill the
> textInput's value instead of LiveUpdate. Can somebody point me to an
> example how to attach JavaScript to selection please?

On my side the SELECT seems to be filled with the wrong values (from 
the context key), but the general idea should be there:

#renderContentOn: html
html attributes onChange: 'updateX();'.
	sourceId := html ensureId.
	html
		selectFromList: #('apple' 'orange' 'mango' )
		selected: 'apple'
		callback: [:v | v].
	destinationId := html ensureId.
	html
		textInputWithCallback: [:v | v inspect].
	html script: 'function updateX() {document.getElementById(' , 
destinationId printString , ').value = document.getElementById(' , 
sourceId printString , ').value;}'

--
HweeBoon
http://motionobj.com/blog/
MotionObj
(65) 6764-9774



More information about the Seaside mailing list