struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Leland <>
Subject Delegation and Event Model for Struts ?
Date Tue, 10 Oct 2000 14:26:55 GMT
Besides using inheritance to extend functionality, it would
be useful in future versions to use 'Delegation'. Just like
version 1.0 of the AWT library was expanded to use Delegation
and the event model in version 1.1 & 1.2

So as an alternate to using ValidatingActionForm we could
use ActionForm which has an OnValidate Event.

So in ActionForm there would be code such as
if (OnValidate != null) then

Other events, that are loosely based on my experience with JBuilder/AWT/Delphi
and DataSets:
OnValidate - Called before values saved to ActionForm. To prevent saving
                     values to ActionForm throw an exception.
OnEditError - Called when an exception was thrown when changing a single field
OnUpdateError - Called when an exception was thrown when changing the
                           entire form data.
OnBeforeCancel - Called before the editing of a form is about to be canceled.
OnChanged - Called after all field validations have been performed and
                      a field value has stored in the ActionForm. Any subsiquent

                      refreshes will return this value to the browser. However,
                      this value is not stored to any underlying database yet.
OnBeforePost - User has submitted data. This event is called after the
OnAfterPost - Called after data has been submitted to database.

OnDataChanged - Form is setup to do a post as each field is changed,
                            which is sent back to the server for processing.
OnBeforeClose  - The session/request has timed out or has terminated normally
                            by performing another action.
OnBeforeOpen - This is called before the first request this form will process.

If the ActionForm does not have individual classes associated with
each field an additional property could be added called :
SummitMethod = (smAll, smEach)
If the ActionForm does have classes representing each field then
those fields could have events for validation etc...

To be performed right these changes need to be changed

View raw message