[Seaside] action before value changing in forms?

Ragnar Hojland Espinosa ragnar at linalco.com
Wed Jun 18 16:14:10 CEST 2003


I'd need to be able to execute a method or block before values change
for the fields of a form.

The reason for this is that I have to run 

    "ExDB current" returns a GlorpSession singleton"
    (ExDB current) register: company.

with the original company right before the company object is changed
so the GLORP unit of work doesn't get messed up when someone backs his
browser.   Right now I've put it in initialize, but its certainly not
the best place.

Other alternatives welcome.
    

ExEditCompany>>company


renderContentOn: html
	html form: [ html table: [
		
		html tableRow: [
			html tableHeading: [ html text: 'Fax' ].
			html tableData: [ html textInputOn: #faxPhone of: company length: 25] ].

		html tableRowWith: [ html submitButtonWithAction: [ self onAccept ] text: 'Aceptar' ].
        ] ]

	
initialize
	|db|
	db _ ExDB current.
	(db hasUnitOfWork) ifFalse: [
		db beginUnitOfWork.	
	]

	
company: aCompany
	company _ aCompany.
	(ExDB current) register: company.
	
	
onAccept
	(ExDB current) commitUnitOfWork.
	self answer.


-- 
Ragnar Hojland - Project Manager
Linalco "Especialistas Linux y en Software Libre"
http://www.linalco.com Tel: +34-91-5970074 Fax: +34-91-5970083


More information about the Seaside mailing list