Parent to WPagelet, mainly containing Event stubs.
Overrides should always call super.
The events are generally grouped by pagelet, so that all of a pagelets
processing happens at once.
But each pagelet's OnInitalize method is called first.
Then each pagelets feilds are loaded but not validated.
This is done before the non-interleaved events so that pagelets could interact with each other if really needed.
Then the for each pagelets their onPreValidate/Field Valdiation, *Submitted and Error events are called.
These are not interleaved with other pagelets.
These non-interleaved methods can throw WValidationErrors will be caught and displayed to the user.
This will prevent any further proccessing non-interleaved methods of this pagelet, but the page will continue.
So a Crud error will not prevent a tree or list pagelet from working.
Then the onListRow methods are called as seen in the JSP.
Finally each pagelet's onFinalize is called, after the JSP exits.
Normally a database connection is shared between pagelets, with error events doing rollbacks.
Open the connection on the Page initializer, not the pagelet one.
This approach keeps things simple.
(Why is this more complex than Rails (say)? Mainly because we support the
implementation of independently written pagelets.)
(See WPageStructure.main() for precice details as to how these are called.)
(Having the *Submitted events is a little more compex than just having one
doBody event and testing if wasSubmitted within it. But it is convenient to have
these split up for the user.
Individual buttons are not split up because typically one wants shared processing
between Insert, Update, Delete user actions.)
(To extend a Page/Pagelet one simply subtypes them, and thus having access to
the super types events.
However, might allow other non-pagelet classes to extend this directly later,
and then regester themselves to receive the events. But not now.)
|