1 Reply Latest reply on Sep 9, 2008 4:05 PM by chris.simons

    Can you bind a commandLink action to a ui:param?


      I'm trying unsuccessfully to implement a container of possible buttons and their values.


      I want the commandLinks to be based around an image.


      Therefore, I am using a ui:include and sending in several parameters to this template, including an action parameter.  Is this even possible?


      I have been unsuccessful getting the action parameter to be bound successfully to the h:commandLink, like so:


      <h:commandLink action="#{action}">
             <h:graphicImage value="#{theme.imgdir}/data-table/page_white_edit.png"
                          alt="#{alt}"/>
      </h:commandLink>
      



      Everything looks fine, but when I click the link, I get the following stack trace:


      Caused by: javax.faces.el.EvaluationException: javax.el.PropertyNotFoundException: /layout/tables/action-edit-button.xhtml @9,35 action="#{action}": /pm/pds/viewPersonalProfile.xhtml @370,84 value="#{userProfileManager.modifyEmergencyContact}": Property 'modifyEmergencyContact' not found on type org.javassist.tmp.java.lang.Object_$$_javassist_7
              at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:84)
              at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)




      I'd prefer to use some custom EL tags/notation but I've been unsuccessful at getting my project to deploy using this feature.


      If anyone has a better way of accomplish what I'm trying to do, please feel free to show me the way.


      Thanks.

        • 1. Re: Can you bind a commandLink action to a ui:param?

          I sort of got this to work, like so:



          <h:commandLink action="#{backingBean[method]}" />



          But it won't adhere to pages.xml in the case that the action is a method but with a redirect that is specified in pages.xml.


          Does anyone know of a way to get both to work?  Will I need to use a custom EL function/component?