...
If there is no exception event handler, or the exception event handler returns null (or is void), then the exception will be passed to the RequestExceptionHandler service, which (in the default configuration) will render the exception page.
Triggering Events
If you want your own component to trigger events, just call the triggerEvent method of ComponentResources from within the component class.
For example, the following emits an "updateAll" event. A containing component can then respond to it, if desired, with an "onUpdateAll()" method in its own component class.
...
language | java |
---|---|
title | Your component class (partial) |
...
Wiki Markup |
---|
{float:right|background=#eee|padding=0 1em} *JumpStart Demo:* |
...
[AJAX |
...
Components CRUD|http://jumpstart.doublenegative.com.au/jumpstart/together/ajaxcomponentscrud/persons]
{float} |
For example, the following emits an "updateAll" event. A containing component can then respond to it, if desired, with an "onUpdateAll()" method in its own component class.
Code Block | ||||
---|---|---|---|---|
| ||||
@Inject
ComponentResources componentResources;
...
private void timeToUpdate() {
boolean wasHandled = componentResources.triggerEvent("updateAll", null, null);
if (wasHandled) {
...
}
} |
The third parameter to triggerEvent is a ComponentEventCallback, which you'll only need to implement if you want to get the return value of the handler method. The return value of triggerEvent() says if the event was handled or not.
The third parameter to triggerEvent is a ComponentEventCallback, which you'll only need to implement if you want to get the return value of the handler method. The return value of triggerEvent() says if the event was handled or not. {float:right|background=#eee|padding=0 1em}
*JumpStart Demo:*
[AJAX Components CRUD|http://jumpstart.doublenegative.com.au/jumpstart/together/ajaxcomponentscrud/persons]
{float} Wiki Markup