2 Replies Latest reply on May 28, 2009 12:04 PM by Jay Haley

    Migration to 3.3.1 problem - commandLink with actionparam

    Jay Haley Newbie

      I've encountered a problem when migrating from version 3.2.2 to 3.3.1. In 3.2.2, once I get into my actionListener the mapAddressBean values have been correctly set by the a4j:actionParam. However, with 3.3.1 they have not.

      Or stated another way, in 3.2.2 the actionParam gets set prior to the actionListener being called. And 3.3.1 is just the other way around.

      <a4j:commandLink value="Map" oncomplete="Richfaces.showModalPanel('panelMapAddress')"
       actionListener="#{extraStopsCtrl.mapAddress}" reRender="errorPanelGroup,extraStopInfo"
       process="extraStopAddress1,extraStopCity,extraStopState,extraStopZip" ajaxSingle="true" >
       <a4j:actionparam assignTo="#{mapAddressBean.street}" value="#{quote.extraStopsInfo.workingExtraStop.address1}"/>
       <a4j:actionparam assignTo="#{mapAddressBean.city}" value="#{quote.extraStopsInfo.workingExtraStop.city}"/>
       <a4j:actionparam assignTo="#{mapAddressBean.state}" value="#{quote.extraStopsInfo.workingExtraStop.state}"/>
       <a4j:actionparam assignTo="#{mapAddressBean.postalCode}" value="#{quote.extraStopsInfo.workingExtraStop.zip}"/>
       <a4j:actionparam assignTo="#{currentOpportunity.modalLaunchClicked}" value="#{modalMapAddressCtrl.extraStops_Addr}" />
      </a4j:commandLink>
      


        • 1. Re: Migration to 3.3.1 problem - commandLink with actionpara
          Ilya Shaikovsky Master

          Discussed many times at this forum. We just changed the behavior according to JSF specification.

          Nested action listeners according to spec should be fired after the parent components action listerner. And a4j:action param works as action listener. So move action listener definition to the action param tag.

          • 2. Re: Migration to 3.3.1 problem - commandLink with actionpara
            Jay Haley Newbie

            Thanks, that works in the above example but I have now run across an example that does not work. I've outlined my attempts below, but am unable to find a resolution.

            Works with 3.2.2 #{accessorial.selected} is set after actionListener called

            <a4j:repeat value="#{quote.accessorials.selectedAccessorials}" var="accessorial">
             <a4j:commandLink value="Edit"
             actionListener="#{accessorialsCtrl.editAccessorial}" ajaxSingle="true"
             rendered="#{accessorial.editable}"
             reRender="panelTitleRoomName,accessorialDetailFrm"
             oncomplete="Richfaces.showModalPanel('panelaccessorialDetail')">
            
             <f:setPropertyActionListener target="#{accessorial.selected}" value="true" />
             </a4j:commandLink>
            </a4j:repeat>
            


            #{accessorial.selected} is set but actionListener is never called
            <a4j:repeat value="#{quote.accessorials.selectedAccessorials}" var="accessorial">
             <a4j:commandLink value="Edit"
             rendered="#{accessorial.editable}"
             reRender="panelTitleRoomName,accessorialDetailFrm"
             oncomplete="Richfaces.showModalPanel('panelaccessorialDetail')">
            
             <f:setPropertyActionListener target="#{accessorial.selected}" value="true" />
             <a4j:actionparam actionListener="#{accessorialsCtrl.editAccessorial}"></a4j:actionparam>
             </a4j:commandLink>
            </a4j:repeat>
            


            #{accessorial.selected} is never set but actionListener is called
            <a4j:repeat value="#{quote.accessorials.selectedAccessorials}" var="accessorial">
             <a4j:commandLink value="Edit"
             rendered="#{accessorial.editable}"
             reRender="panelTitleRoomName,accessorialDetailFrm"
             oncomplete="Richfaces.showModalPanel('panelaccessorialDetail')">
            
             <a4j:actionparam actionListener="#{accessorialsCtrl.editAccessorial}" assignTo="#{accessorial.selected}" value="true"></a4j:actionparam>
             </a4j:commandLink>
            </a4j:repeat>
            


            #{accessorial.selected} is never set and actionListener is never called
            <a4j:repeat value="#{quote.accessorials.selectedAccessorials}" var="accessorial">
             <a4j:commandLink value="Edit"
             rendered="#{accessorial.editable}"
             reRender="panelTitleRoomName,accessorialDetailFrm"
             oncomplete="Richfaces.showModalPanel('panelaccessorialDetail')">
            
             <a4j:actionparam assignTo="#{accessorial.selected}" value="true"></a4j:actionparam>
             <a4j:actionparam actionListener="#{accessorialsCtrl.editAccessorial}" ></a4j:actionparam>
             </a4j:commandLink>
            </a4j:repeat>