Override of Event Handlers
You can override an event handler by calling the base method or without calling it.
To override an event handler without invocation of the base method, use code based on the following template.
protected virtual _(Events.[EventName]<[DACName], [FieldName]> e)
{
…
}
To override an event handler with invocation of the base method, use code based on the following template.
protected virtual void _(
Events.[EventName]<[DACName], [FieldName]> e,
PX[EventName] baseMethod)
{
baseMethod(e.Cache, e.Args);
…
}
Note: For a base method, you should provide two parameters because a base method is a classic
interceptor delegate, not a generic one. For details, see Types of Graph Event Handlers.
For example, to override an event handler for the RowSelected event of
the CurrencyInfo
class, use the following code.
protected virtual void _(Events.RowSelected<CurrencyInfo> e, PXRowSelected baseMethod)
{
baseMethod(e.Cache, e.Args);
}