0

I've got an orderingList with jsf and want to do something when I click an item in my list. I build a composite component and tried to use it like this:

Composite Component

<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>

I use this orderingList as following:

<mycc:orderingList id="myId" clickListener="#{mybean.doEditAction}">
    ...
</mycc:orderingList>

In my bean I have the following methods (for testing):

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");
}

When I open this view I'm getting an PropertyNotFoundException:

The class 'Mybean$Proxy$_$$_WeldClientProxy' does not have the property 'doEditAction'.: javax.el.PropertyNotFoundException:

Whats wrong with my code? I just want to get the selected Item in my bean-method...

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
J. Doe
  • 71
  • 5
  • Read the error carefully, it is seen as 'property', so it searches for a cooresponding getter, not an action method. If you implement 'getDoAction()' it will not give the error but not really work good either. I have no time to find a corresponding Q/A in StackOverflow. Using google for https://www.google.com/search?q=pass+actionMethod+composite+component+ajax might give you some results – Kukeltje Jan 26 '17 at 13:35
  • Thanks, i used google but nothing is working... i used it without an composite component and it worked but now i've got the problem that i can not use my var as an parameter... – J. Doe Jan 26 '17 at 13:51

0 Answers0