[Seaside] Seaside + Scriptaculous: updating checkbox value

Leandro Pérez lperez at lifia.info.unlp.edu.ar
Mon Jun 11 12:53:45 UTC 2007


Hi,
I'm trying to do something like this: 
I have a checkbox displaying the state of a door, i.e. open->checked,
closed->unchecked. When clicking the checkbox, the door must be closed or
opened (a server side model object representing the door is asked to be
closed/opened via ajax). The thing is that according to different variables
evaluated on the model on the server at the time the door is asked to be
closed/opened, it is effectively closed/opened or not, and therefore the
checkbox on the browser might be inconsistent with the real state of the
door after the petition. 
My problem is, I can't find the way to update the value of the checkbox
without refreshing the whole page, i'm currently trying something like this:
renderContentOn: html
...
	html form id:'myForm'; with: [
		(html checkbox)
		id: 'door_checkbox_' , doorNumber printString;	
		value: (myModelDoorManager isDoorClosed: doorNumber);						
                onClick: (html evaluator callback: 	
			[:script | 
                                   myModelDoorManager operateOnDoor:
doorNumber.

                                   ..."here! the checkbox value should be
updated to the proper one obtained from a door model object on the server
side"
				"the value is obtained from the model object in the server side using: 
				myModelDoorManager isDoorClosed: doorNumber"	
			]
		]


i'm currently using
        VisualWorks NonCommercial, 7.5
        Seaside2.7b1
        Scriptaculous2.6-mb.8

Regards, 
Leandro 
-- 
View this message in context: http://www.nabble.com/Seaside-%2B-Scriptaculous%3A-updating-checkbox-value-tf3901404.html#a11060026
Sent from the Squeak - Seaside mailing list archive at Nabble.com.



More information about the Seaside mailing list