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

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

    Chris Simons Expert

      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?


        • 1. Re: Bug with a4j:commandLink action=
          Chris Simons Expert

          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>
           value="Yes" action="#{userProfileManager.setEmergencyContactAddress()}"
          <h:outputText value=" | "/>

          • 2. Re: Bug with a4j:commandLink action=
            Aleksej Yanul Newbie

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