[Seaside] action before value changing in forms?
Julian Fitzell
julian at beta4.com
Thu Jun 19 00:24:54 CEST 2003
Avi will correct me if I'm wrong (and I could be since I'm playing
bridge online while looking up this answer :) but it looks like you
should be able to subclass WAControllerSession and override
#responseWithUrl:callbacks: to call a notification on the root component
(which I guess would have to pass it on).
Now it may be that we need to just add a mechanism for this. Seems like
we've had this before... can't remember if there was a reason for taking
it out or if it just hasn't made it back in the refactoring.
Julian
Ragnar Hojland Espinosa wrote:
> 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.
>
>
--
julian at beta4.com
Beta4 Productions (http://www.beta4.com)
More information about the Seaside
mailing list