Can't “render/not render” a4joutputpanel rende

2019-09-01 05:12发布

问题:

I'm new on seam and richfaces. I want to hide/show a4joutputpanel by rendered="" "true/false" parameter by giving Managed Bean.But ı'm taking this exception:

com.sun.facelets.tag.TagAttributeException: /testscreen.xhtml action="#{testBean.renderActive(true)}" Not a Valid Method Expression: #{testBean.renderActive(true)}

Can anyone help me about that?

Here's my xhtml and managedbean codes:

<a4j:commandButton action="#{testBean.renderActive(true)}" reRender="MyPanel" value="Start" />

<a4j:outputPanel id="MyPanel">
<s:div rendered="#{testBean.renderProperty}">
........
</s:div>
</a4j:outputPanel>

ManagedBean

public void renderActive(Boolean rendeBoolean){
this.renderProperty=rendeBoolean; }

private Boolean renderProperty;

public Boolean getRenderProperty() {
return renderProperty;
}

public void setRenderProperty(Boolean renderProperty) {
this.renderProperty = renderProperty;
}

回答1:

#{testBean.renderActive(true)} is actually not a valid method expression in plain JSF EL because method expressions cannot have parameters.

It's valid with EL extension provided by jboss-el.jar, though.

Check if this jar is present in the application classpath, that is in the EAR or in WEB-INF/lib if you don't package the application as war. (see § 30.3.1 Packaging in the reference documentation).