[Seaside] liveUpdate checkboxes

Bany, Michel mbany at cincom.com
Fri Aug 12 11:14:32 CEST 2005


Another question : if I am not mistaken, there is no live update
possible
for checkboxes, is it ? I tried the things below, but it does not always
work,
any idea ?

Michel.


checkboxWithValue: aBoolean callback: callbackBlock liveCallback:
liveBlock
	| uri id |
	id := self ensureId.
	self checkboxWithValue: aBoolean callback: callbackBlock.
	uri := self urlForLiveRequest: [:v :h | liveBlock value: v =
'true' value: h].
	self script: 'document.getElementById(' , id printString ,
').onclick = liveCheck(' , id printString , ',' , uri asString
printString , ')'.


function liveCheck(id, uri)
{
	function constructUri()
	{
		return addParameter(uri, "s",
document.getElementById(id).checked);
	}
	return liveUpdater(constructUri);
}


More information about the Seaside mailing list