Executing form callbacks within a block

Esteban Maringolo <[email protected]> Wed, 19 May 2021 22:18:27 -0300
Newsgroups gmane.comp.lang.smalltalk.squeak.seaside
Message-ID <CAJMgPCJy34oRRc=Qbf7n4yNaK3GDsmYrc3kP8awNbHBw0+My7g@mail.gmail.com>
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
_______________________________________________
seaside mailing list
[email protected]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside