将方法表达式作为tagfile属性传递

时间:2015-02-18 11:54:37

标签: jsf facelets tagfile methodexpression

我是以下标记文件:

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:a4j="http://richfaces.org/a4j"
>
    ...
    <h:inputText ...>
        <a4j:ajax listener="#{ajaxListener}" />                  
    </h:inputText>
    ...
</ui:composition>

ajaxListener属性配置为:

 <attribute>
   <name>ajaxListener</name>
   <required>false</required>
   <type>javax.el.MethodExpression</type>
   <method-signature>void listner(javax.faces.event.AjaxBehaviorEvent)</method-signature>
 </attribute>

当标签用作:

<wish:inputText id="nameEn"                   
                value="#customerAddBacking.customerBean.nameEn}" 
                label="#{lbs.CUSTOMER_NAME_EN}2"                    
                ajaxEnabled="true"
                ajaxListener="#{customerAddBacking.enNameChangeListener}" /> 

抛出以下异常:

javax.el.PropertyNotFoundException: The class 'com.wish.nags.web.view.client.setting.customer.CustomerAddBacking' does not have the property 'enNameChangeListener'.

这是如何引起的?如何解决?

如果我使用带有<cc:attribute method-signature>的复合组件,它会起作用,但我无法使用复合组件来避免此处所述的问题:a composite component inside panelgrid is not 'expanded'

0 个答案:

没有答案