[Seaside] Executing form callbacks within a block

Esteban Maringolo emaringolo at gmail.com
Thu May 20 01:18:27 UTC 2021


Hi all,

I have a situation where I want to execute _ALL_ the callbacks of the
inputs in the form within a particular block (basically, a DB
transaction).

html form: [
  html textInput on: #name of: self.
  html textInput on: #age of: self.
  html submitButton
]

I want to execute the three callbacks within something else, or at
least have the option to execute something before the first callback
executes and ensure something gets executed after the last one is
executed.

I know it involves fiddling somehow with
WACallbackProcessingActionContinuation, but it's not fully clear if I
could do this.

The hacky alternative would be to have a hidden field that does start
the tx and the submit / cancel commits or cancels it.

html form: [
  html hiddenInput callback: [self beginTransaction].
  html textInput on: #name of: self.
  html textInput on: #age of: self.
  html submitButton
    callback: [self commitTransaction];
    value: 'Submit'.
]

But in this case I'd have to keep the tx "outside" of the form, and
I'd like to wrap everything in a single block.

Is there a way to do this with Seaside?

Thanks!

Esteban A. Maringolo


More information about the seaside mailing list