Friday, July 22, 2005

ADF Event handling precedence

When an event named YourEvent fires, then...

If you have apublic void onYourEvent(DataActionContext ctx) method in the data action class handling the request, it will be invoked to handle the event with custom code.
If you have an action binding in the current binding container named YourEvent, it will be invoked.

When used in combination with 1, your event-handler code needs to explicitly invoke the default action for the current event by using code like:

if (ctx.getEventActionBinding() != null) ctx.getEventActionBinding().doIt();
If you have a Struts forward named YourEvent, it will be used to determine the next page to forward control to.

When used in combination with 1, if your event-handling code invokes ctx.setActionForward(), then your programmatically set forward takes precedence.

No comments: