[Seaside] Cancel Button and

Avi Bryant avi.bryant at gmail.com
Fri Feb 11 21:42:09 CET 2005


On Fri, 11 Feb 2005 15:09:23 -0500, Reg Krock <rkrock3 at cogeco.ca> wrote:

> The Cancel button is also coded with a callback.
> 
>         html submitButtonWithAction: [
>                 self answerZeroTickets] text: 'Cancel'
> 
> The way my code works is if an invalid value had been entered, the
> user gets an error message before the cancel button takes effect.
> 
> The reason is that the input field callback is handled before the
> cancel callback is handled.
> 
> I have ? questions:
> 1) Is this normal web behaviour?

More or less, yes.  It's certainly normal Seaside behavior.  However:

> 2) If it is not normal web behaviour, is there any way for the field
> callback to know that the cancel has also been pressed.

The easiest way to handle this is by using #cancelButtonWithAction:, as below:

html cancelButtonWithAction: [self answerZeroTickets]

If the user clicks on a cancel button that's been defined that way,
Seaside will suppress all the other callbacks that would normally have
been evaluated on that form.

Cheers,
Avi


More information about the Seaside mailing list