2 Replies Latest reply on Mar 10, 2008 10:02 AM by J C

    a4j:commandLink won't invoke action listener

    Stephan Schobloch Newbie

      Hello Forum,

      I need help with a complete esoteric issue concerning the a4j:commandLink tag. I have two command links in my JSP page that both first invoke an action listener which sets a property of my backing bean. Afterwards, a h:panelGrid inside of a modal panel is re-rendered to display the new properties from the bean.

      The relevant code in the JSP page looks like this:

      First Link

      <a4j:commandLink id="edit" reRender="mp_editCruiserContent"
       actionListener="#{cruiserBean.handler.selectCruiser}" immediate="true"
       onclick="Richfaces.showModalPanel('mp_editCruiser')">
       <a4j:actionparam name="selectedCruiserId" value="#{cruiser.cruiserId}" assignTo="#{cruiserBean.selectedCruiserId}" />
       <h:graphicImage alt="Edit" url="/images/edit.png" style="border: 0px; cursor: pointer" />
      </a4j:commandLink>


      Second Link
      <a4j:commandLink id="delete" reRender="mp_confirmDeleteContent"
       actionListener="#{cruiserBean.handler.selectCruiser}" immediate="true"
       onclick="Richfaces.showModalPanel('mp_confirmDelete')">
       <a4j:actionparam name="selectedCruiserId" value="#{cruiser.cruiserId}" assignTo="#{cruiserBean.selectedCruiserId}" />
       <h:graphicImage alt="Delete" url="/images/delete.png" style="border: 0px; cursor: pointer" />
      </a4j:commandLink>


      As you might see, the two links are almost the same, aside from the id of the modal panel to show and the image file for the link icon. That's why I don't understand why the second link invokes the action listener method on my bean, while the first one doesn't. The first thing performed by the action listener method is

      System.out.println("In there!");


      And that output is only plotted to the console when I activate the second link.

      Since I am completely at a loss by now (having even compared the code snippets with a text compare tool), I would appreciate any help on this issue.

      Thanks in advance,
      Talwyn