JSF2 compound expression cc.attrs does not correctly evaluate action parameters

I have a JSF component component, which is a list of email addresses that can be dynamically added and removed from:

<composite:interface shortDescription="Display party email addresses">
    <composite:attribute name="addressable" required="true"/>
</composite:interface>

<composite:implementation>  
    <h:panelGroup layout="block" id="emails">
        <h:dataTable id="emailList" value="#{cc.attrs.addressable.emailAddresses}" var="email" styleClass="data-list small-list" cellpadding="0" cellspacing="0">
            <h:column>
                <f:facet name="header">Address</f:facet>
                <h:inputText id="emailAddress" value="#{email.address}" size="30" maxlength="100" required="true" label="Email"/>
            </h:column>
            <h:column>
                <f:facet name="header">Description</f:facet>
                <h:inputText id="emailDescription" value="#{email.description}" size="20" maxlength="100"/>
            </h:column>        
            <h:column>
                <f:facet name="header">
                    <h:panelGroup styleClass="right-align" layout="block">
                        <h:commandLink id="addEmail" action="#{cc.attrs.addressable.addEmailAddress}" title="Add an email address">
                            <f:ajax execute=":#{cc.clientId}:emails" render=":#{cc.clientId}:emails"/>
                            <h:graphicImage library="images" name="add.png" id="emailAddImg"/>
                        </h:commandLink>
                    </h:panelGroup>
                </f:facet>
                <h:commandLink id="deleteEmail" action="#{cc.attrs.addressable.remove(email)}" title="Remove the email from this row">
                    <f:ajax execute=":#{cc.clientId}:emails" render=":#{cc.clientId}:emails"/>
                    <h:graphicImage library="images" name="delete.png" id="emailDeleteImg"/>
                </h:commandLink>
            </h:column>          
        </h:dataTable> 
    </h:panelGroup>
</composite:implementation>

This component is used as follows:

<edit:emailAddresses addressable="#{personAddressable}" id="emailAddresses"/>

When the deleteEmail action is called, it throws an exception:

ERROR [STDERR] Called: javax.el.MethodNotFoundException: /resources/edit/emailAddresses.xhtml @ 34,130 action = "# {cc.attrs.addressable.remove (email)}": method not found: View of the interface for the endpoint [ jboss.j2ee: jar = tephra.war, name = PersonAddressable, service = EJB3] and session 3j011-mgweoj-ghfwhlvv-1-ghfy2e5j-e1.remove ()

, personAddressable.remove(email), ! . , , .

bean, , . bean (CDI).

JBoss AS6-M5, el 2.2.

+3
1

Tomcat 7.0.5, Glassfish 3.0.1. , EL Tomcat. : Tomcat Bug 50449.

JBoss Tomcat, , JBoss .

() f:setPropertyActionListener.

<h:commandLink action="#{cc.attrs.addressable.remove}">
    <f:setPropertyActionListener target="#{cc.attrs.addressable.email}" value="#{email}" />

email Addressable bean, .

+4

Source: https://habr.com/ru/post/1779140/


All Articles