2 Replies Latest reply on Apr 8, 2008 9:46 AM by ayanul

    Bug with a4j:commandLink action="xyz()"?

      I was puzzled by this for quite a while until I was able to narrow down the issue.

      Within an s:decorate, I have two a4j:commandLinks that called separate actions (example: one called "clear()" and the other called "set()".

      What I started to notice was that each time the page/form rerRendered due to clicking one of these a4j:commandLinks that the action of the second a4j:commandLink was being called each time.

      As you can imagine, I would click "set()" but then see in the logs that "clear()" was also being called.

      By chance, I removed the "()" from "clear()" and the issue is no longer happening. Yet I kept the "()" after "set" and it's not like "set()" is being called!

      So why would "clear()", which is assigned to the "action" parameter on an a4j:commandLink get called everytime the page loads?

      Am I missing some fundamental knowledge about EL or is this a strange occurrence?

      Thanks.

        • 1. Re: Bug with a4j:commandLink action=

          To give you a better idea of the code, here it is:

          <s:decorate id="reusePhysicalHomeAddressDecorate" template="/layout/forms/edit.xhtml">
          <ui:param name="colspan" value="1"/>
          <ui:define name="label">Reuse My Physical Home Address:</ui:define>
           <a4j:commandLink
           id="cmdReusePhysicalHome"
           value="Yes" action="#{userProfileManager.setEmergencyContactAddress()}"
           ajaxSingle="true"
           reRender="createNewEmergencyContactForm">
          </a4j:commandLink>
          <h:outputText value=" | "/>
          <a4j:commandLink
           id="cmdResetPhysicalHome"
           value="Reset"
           action="#{userProfileManager.clearEmergencyContactAddress}"
           ajaxSingle="true"
           reRender="createNewEmergencyContactForm">
           </a4j:commandLink>
          </s:decorate>
          


          • 2. Re: Bug with a4j:commandLink action=
            ayanul

            Hi Chris!
            I cannot reproduce it.
            What lib at you are used, and show web.xml
            Or attach an example where it is reproduced