1

I am trying put method and String in a action property of a menuitem (primefaces).

Code:

    <p:submenu label="Permissao" icon="ui-icon-note">
        <p:menuitem value="Editar" action="#{principalTemplateBean.sistemaPath}/permissao/editar" ajax="false"/>
    </p:submenu>

But when I run I got this:

    Caused by: javax.el.ELException: Not a Valid Method Expression: #{principalTemplateBean.sistemaPath}/permissao/editar
at com.sun.el.lang.ExpressionBuilder.createMethodExpression(ExpressionBuilder.java:311)
at com.sun.el.ExpressionFactoryImpl.createMethodExpression(ExpressionFactoryImpl.java:96)
at org.jboss.weld.util.el.ForwardingExpressionFactory.createMethodExpression(ForwardingExpressionFactory.java:43)
at org.jboss.weld.el.WeldExpressionFactory.createMethodExpression(WeldExpressionFactory.java:53)
at org.jboss.weld.util.el.ForwardingExpressionFactory.createMethodExpression(ForwardingExpressionFactory.java:43)
at org.jboss.weld.el.WeldExpressionFactory.createMethodExpression(WeldExpressionFactory.java:53)
at com.sun.faces.facelets.tag.TagAttributeImpl.getMethodExpression(TagAttributeImpl.java:240)
Regis Albuquerque
  • 138
  • 1
  • 1
  • 10
  • I put url instead of action property. And add a extension jsf cause in my web.xml the url-pattern is "*.jsf" url="#{principalTemplateBean.sistemaPath}/permissao/editar.jsf" – Regis Albuquerque Sep 15 '16 at 18:34

1 Answers1

1

The action attribute is for calling a method in the backing bean, not for navigation. Use outcome or url for that, depending on whether you call an external URL.

You can find more information on this here: link from <p:menuitem> to certain <p:tab>

Community
  • 1
  • 1
Ingo Bürk
  • 19,263
  • 6
  • 66
  • 100