Hi all,

today I introduced a new prefix class for buttons in the 'form' GUI.

This was a long-missing feature, and I feel I have to explain the
background a little:

When a button is pressed in a form, a 'chk>' message is sent to all
'gui' components in that form. If one or several of those method
invocations return an error message, these messages are collectively
displayed in an error alert, and the execution of the button's action
method (i.e. 'act>') is effectively inhibited.

This is usually a good thing, because type checks on input fields (e.g.
'+DateField') or database relations (e.g. '+E/R') are automatically
handled, and wrong inputs will not be seen or processed by the

However, there are problems.

If, for example, a database relation for an object includes the '+Need'
prefix, and such an object got somehow created and committed without the
required field filled-in, this object could never be repaired in the
GUI, because the "Edit" button would display the "Input required"
message, and refuse to do its work (i.e. put the object page into edit

Or, the "Cancel" button would not allow to close a dialog with fields
that cause an error message. While this is correct for the "OK" button,
the expected behavior for a "Cancel" button is to ignore the errors and
simply throw away the dialog.

So, now there is a '+Force' prefix class, which overrides any error
messages, and forces the execution of the button's action method.

It takes a single 'exe' argument, specifying a condition for that
behavior. If it evaluates to non-NIL, the button will execute,
regardless of any error situations.

(Note that in combination with the '+Chk' prefix class you can override
this again, and perform specialized checks if needed)

'+Force' is now built-in into the 'cancelButton' function, and also the
standard "Edit" / "Save" button (usually created with the 'editButton'
function). Therefore the above problems are resolved with this fix.

Let's hope I didn't introduce new problems with this solution ;-)
Any feedback is welcome!

- Alex

Reply via email to