...
Since | ||
---|---|---|
| ||
Starting in release 5.3, Tapestry will throw an exception if the component identified for the event handler method doesn't exist in the containing component's template. This helps prevent typos. However, this behavior can be overridden using the @DisableStrictChecks annotation (added in release 5.6.2). |
In the above example, the editDocument() method will be invoked when any event occurs in in the "edit" component (and has at least one context value).
...
Div | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
|
...
Tapestry triggers a new event, of type "exception", passing the thrown exception as the context. In fact, the exception is wrapped inside a ComponentEventException, from which you may extract the event type and context.
...
Div | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
|
...
If you want your own component to trigger events, just call the triggerEvent
method of ComponentResources from within your component class.
...