4 Replies Latest reply on Jul 23, 2008 10:45 AM by nimo stephan

    Difference of a4j:actionparam and f:setPropertyActionListene

    nimo stephan Master

      What is the difference (ability, performance,..) between the two components:

      a4j:actionparam

      and

      f:setPropertyActionListener

      The richFaces-Manual compare the a4j:actionparam as follows:

      The <a4j:actionparam> component combines the functionality of both JSF components:
      <f:param> and <f:actionListener> .


      It should compare it with f:setPropertyActionListener instead of the <f:param> and <f:actionListener>.



        • 1. Re: Difference of a4j:actionparam and f:setPropertyActionLis
          nimo stephan Master

          I have found out, that
          a4j:actionparam need the attribute "name" to work well, where f:setPropertyActionListener need (and have) no "name" attribute. It works well and it seems a little faster.

          • 2. Re: Difference of a4j:actionparam and f:setPropertyActionLis
            Ilya Shaikovsky Master

            Yes a4j:actionparam tag is similar <f:setPropertyActionListener> from the Core tag library. However, one important difference exists. <a4j:actionparam> inserts the value into the request thus it might require a custom converter for objects which JSF doesn’t know how to convert. <f:setPropertyActionListener> select a value from the model and thus doesn’t require a converter.

            • 3. Re: Difference of a4j:actionparam and f:setPropertyActionLis
              nimo stephan Master

              You say <a4j:actionparam> "inserts the value into the request thus..".

              I use this tag to push a data into a list (in a session Bean) - However, this takes a while. Can I enforce within the tag (with an property), that it should store the data in the session by assigning the trigger to a button?

              Look at that:

              I have about 20 links into one page:

              <h:commandLink immediate="true">
              <a4j:actionparam name="selectThis" value="#{this}/#{that}" assignTo="#{sessionBean.myListOfThisAndThat}"/>
              </h:commandLink>
              


              When the User clicks one link, then the value "this/that" is stored into the list for this session - but I want to store it in the session, when the User clicks the OK button. So the User does not have to wait between the time clicking the links.

              So what I wanna have is: To assign all the values comming from "myListOfThisAndThat" when the User clicks the Button "OK".

              How can I achieve that ???



              • 4. Re: Difference of a4j:actionparam and f:setPropertyActionLis
                nimo stephan Master

                I have tried it at first with an hiddenField, but with every link-click the old value is overwritten by the newest one..

                What Tag is appropriate for my problem?