【问题标题】:Not a Valid Method Expression不是有效的方法表达式
【发布时间】:2012-02-17 12:34:59
【问题描述】:

我已经定义了这样的组合:

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:rich="http://richfaces.org/rich"
            xmlns:composite="http://java.sun.com/jsf/composite"> 

<composite:interface>
    <composite:attribute name="varAction" method-signature="java.lang.String action()" required="true" />
</composite:interface>
<composite:implementation>
    <h:outputLink value="#"
                  onclick="#{cc.attrs.varAction}"
                  styleClass="ES_popupClose">
        <h:graphicImage url="/resources/images/close_panel.png" title="#{mess.labelClose}"/>
    </h:outputLink>
</composite:implementation>

当我用

调用这个对象时
<es:esUtilClosePanel varAction="#{rich:component('ESBankDeletePanel')}.hide();"/>

我收到以下错误:

不是一个有效的方法表达式:#{rich:component('ESBankDeletePanel')}.hide();

有人可以帮我吗?

【问题讨论】:

    标签: jsf jsf-2 el composite-component


    【解决方案1】:

    这确实不是一个有效的方法表达式。方法表达式旨在调用支持 bean 操作方法。它旨在用于UICommand 组件的action 属性。你所拥有的只是一个价值表达。从复合属性定义中删除 method-signature。这样它就会被视为一个值表达式。

    <composite:attribute name="varAction" required="true" />
    

    【讨论】:

    猜你喜欢
    • 2013-11-27
    • 1970-01-01
    • 1970-01-01
    • 2013-12-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-04
    • 1970-01-01
    相关资源
    最近更新 更多