Announcement Announcement Module
Collapse
No announcement yet.
Facelets, Template - does not reference a MethodExpression Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Facelets, Template - does not reference a MethodExpression

    I am getting an exception with my Facelet tag which has a variable for a commandLink action property named event. If the variable is replaced with a hardcoded string its works (but isnt very useful).

    I am using Facelets/JSF for the view obviously.

    Code:
    <h:commandLink action="${event}" ...>
    Code:
    javax.faces.el.EvaluationException: /WEB-INF/facelets/tags/myfaces/column-command-link.xhtml @12,75 action="${event}": Identity 'event' does not reference a MethodExpression instance, returned type: java.lang.String
    	com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
    	org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
    	javax.faces.component.UICommand.broadcast(UICommand.java:109)
    	javax.faces.component.UIData.broadcast(UIData.java:517)
    Anyone come across this problem?

  • #2
    Are you trying to extract the value of 'event' from a page property?

    I would not expect this to work. The action property needs to either be a hardcoded string, or it needs to be a method expression that resolves to a no-arg method that returns a String.

    -Jeremy

    Comment


    • #3
      Originally posted by jeremyg484 View Post
      Are you trying to extract the value of 'event' from a page property?

      I would not expect this to work. The action property needs to either be a hardcoded string, or it needs to be a method expression that resolves to a no-arg method that returns a String.

      -Jeremy
      Hi Jeremy

      Yes, the transition event id its being passed into the template.

      Tag
      Code:
      <xxx:columnCommandLink title="#{messages['label.name']}" ... event="#{backingBean.select}">
        ...
      </xxx:columnCommandLink>
      Template
      Code:
      <h:commandLink ... action="${event}" ...>
       ..
      </h:commandLink>
      If I hardcode the action in the template as a string or method expression it works...its there no way to pass this value as a variable...this currently only seems to not work on the 'action' property of commandLink.

      Regards.

      Comment


      • #4
        Resolved.

        Format of action must be: action="#{<backingBean>[<event>]}"

        For value bindings you can use this format #{<backingBean>.<event>}

        Comment


        • #5
          I couldnīt manage to get this working...

          My template source:

          Code:
          	<rich:toolBarGroup>
          		<a4j:commandLink action="#{action}" styleClass="toolbar-button">
          			<h:graphicImage id="#{id}" value="#{image}" title="#{label}" style="vertical-align: middle;"/>
          			<h:outputLabel for="#{id}" value="#{label}" style="vertical-align: middle;" />
          		</a4j:commandLink>
          	</rich:toolBarGroup>
          My page source:
          Code:
          <sdtt:toolbarButton id="new" label="Nova Sir" image="/images/newitem.gif" action="newSir" />
          And I get the following error: "Identity 'action' does not reference a MethodExpression instance, returned type: java.lang.String".

          Any hints?

          Comment


          • #6
            Solved!

            I solved my problem using the ActionMapperTagHandler solution from the richfaces photoalbum example app.

            Itīs simple, but it took me a lot of googling to find:

            http://docs.jboss.org/richfaces/late...ml/Button.html

            Comment

            Working...
            X