delegateViewEvent
Delegates events from the current view.
protected
protected delegateViewEvent(event: ManagedEvent): boolean | Promise<unknown>
Notes
- This method is called automatically when an event is emitted by the current view object.
- The base implementation calls activity methods starting with
on
, e.g.onClick
for aClick
event. The event is passed as a single argument, and the return value should either betrue
, undefined, or a promise (which is awaited just to be able to handle any errors). If the return value istrue
or a promise, the event is considered handled and no further action is taken. Otherwise, the event is emitted again on the ViewComposite instance itself. - This method may be overridden to handle events in any other way, e.g. to propagate them by emitting the same event on the ViewComposite instance itself.
Parameters
- event — The event to be delegated (from the view)
Return value
This method always returns true
since the event is either handled or emitted again.
Related
- class ViewComposite abstractA class that encapsulates a dynamic view.