【发布时间】:2013-08-29 13:36:19
【问题描述】:
尝试动态设置a4j:ajax 的event 时:
<a4j:ajax event="#{myBean.event}" listener="#{myBean.listener}" />
我收到以下错误:
<a4j:ajax> The 'event' attribute for behavior tag must be a literal
好像来自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");
}
}
我想编写自己的CustomBehaviorHandler 以使其按我的需要运行。问题是:如何向 JSF 注册这个新的CustomBehaviorHandler?
或者有没有其他方法可以满足我的需要?
我找不到任何关于它的示例或文档,但这似乎是可能的,因为 PrimeFaces 有自己的org.primefaces.component.behavior.ajax.AjaxBehaviorHandler。
【问题讨论】: