flavio
flavio

Reputation: 11

Not a Valid Method Expression

I have defined a composition like this :

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

When I call this object with

<es:esUtilClosePanel varAction="#{rich:component('ESBankDeletePanel')}.hide();"/>

I get the following error :

Not a Valid Method Expression: #{rich:component('ESBankDeletePanel')}.hide();

Can somebody help me ?

Upvotes: 1

Views: 3128

Answers (1)

BalusC
BalusC

Reputation: 1109725

This is indeed not a valid method expression. A method expression is intented to invoke a backing bean action method. It's intented to be used on action attribute of the UICommand components. What you've there is just a value expression. Remove the method-signature from the composite attribute definition. This way it'll be treated as a value expression.

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

Upvotes: 2

Related Questions