0 Replies Latest reply on Nov 14, 2007 11:10 PM by Ken Moore

    actionParam bad, setPropertyActionListener good, why?

    Ken Moore Newbie

      I've got a situation where setPropertyActionListener works, but actionParam does not. What gives?

      The following code works, with setPropertyActionListener, in that the setExpandStateId method gets invoked when I click the link. If I change to actionParam, the setExpandStateId method does not get invoked. Why is that?

      <h:form id="runStateForm">
       <rich:dataTable id="deviceStatus" styleClass="inner-fieldset-group" var="projectDeviceStateSummary"
       value="#{projectManagerBean.projectDeviceStateSummaries}">
       <rich:column>
       <f:facet name="header"><h:outputText value="Step"/></f:facet>
       <a4j:region>
       <a4j:commandLink reRender="deviceStatus"
       action="#{projectManagerBean.testAction}"
       immediate="true">
       <f:setPropertyActionListener
       target="#{projectManagerBean.expandStateId}"
       value="#{projectDeviceStateSummary.stateId}"/>
       <h:outputText value="+#{projectDeviceStateSummary.stateId}" />
       </a4j:commandLink>
       </a4j:region>
       <h:outputText value="#{projectDeviceStateSummary.stateName}" />
       </rich:column>
      
       <rich:column>
       <f:facet name="header"><h:outputText value="Complete"/></f:facet>
       <h:outputText value="#{projectDeviceStateSummary.completeCount}" />
       </rich:column>
       </rich:dataTable>
      </h:form>


      If I move the Ajax related code outside of the dataTable, then actionParam does work. See that code below. Very mysterious.

      <a4j:region>
       <h:form id="runStateFormx">
       <a4j:commandLink reRender="deviceStatus" action="#{projectManagerBean.testAction}">
       <a4j:actionparam value="2" assignTo="#{projectManagerBean.expandStateId}"/>
       <h:outputText value="+2" />
       </a4j:commandLink>
       </h:form>
      </a4j:region>