When trying to dynamically set the event
of an a4j:ajax
as follow:
<a4j:ajax event="#{myBean.event}" listener="#{myBean.listener}" />
I get the following error:
<a4j:ajax> The 'event' attribute for behavior tag must be a literal
It seems to come from javax.faces.view.facelets.BehaviorHandler
:
public BehaviorHandler(BehaviorConfig config) {
super(config);
this.behaviorId = config.getBehaviorId();
this.event = this.getAttribute("event");
if (null != event && !event.isLiteral()) {
throw new TagException(this.tag, "The 'event' attribute for behavior tag must be a literal");
}
}
I would like to write my own CustomBehaviorHandler
to make it behave as I need. The question is: how to register this new CustomBehaviorHandler
with JSF?
Or is there any other way to suit my needs?
I can't find any example nor documentation about it, but it seems to be possible, since PrimeFaces has its own org.primefaces.component.behavior.ajax.AjaxBehaviorHandler.