我有一个带有jsf的orderingList ,当我单击列表中的一个项目时想要做一些事情。我构建了一个复合组件并尝试像这样使用它:
复合组件
<cc:interface>
<cc:attribute name="listId" />
<cc:attribute name="value" type="java.util.List"/>
<cc:attribute name="var"/>
<cc:attribute name="clickListener"/>
</cc:interface>
<cc:implementation>
<rich:orderingList id="#{cc.attrs.listId}" value="#{cc.attrs.value}">
<c:set target="#{component}" property="var" value="#{cc.attrs.var}"/>
<a4j:ajax event="click" listener="#{cc.attrs.clickListener}"/>
</rich:orderingList>
</cc:implementation>
我使用这个orderingList如下:
<mycc:orderingList id="myId" clickListener="#{mybean.doEditAction}">
...
</mycc:orderingList>
在我的 bean 中,我有以下方法(用于测试):
public void doEditAction(AjaxBehaviorEvent pEvent) {
System.out.println("EVENT FIRED WITH AJAX EVENT");
}
public void doEditAction() {
System.out.println("EVENT FIRED WITHOUT PARAMS");
}
public void doEditAction(ActionEvent pActionEvent) {
System.out.println("EVENT FIRED WITH ACTION EVENT");
}
当我打开这个视图时,我得到一个PropertyNotFoundException:
类“Mybean$Proxy$_$$_WeldClientProxy”没有属性“doEditAction”。:javax.el.PropertyNotFoundException:
我的代码有什么问题?我只想在我的 bean-method 中获取选定的项目...