3 Replies Latest reply on Jan 19, 2009 8:14 PM by fabmars

    a4j:commandButton and f:stPropertyActionListener

    fabmars

      Hello
      I just upgraded to RF3.3.0 (+JSF RI 1.2.11, Facelets and Glassfish)


      I have fully read and understood this one: https://jira.jboss.org/jira/browse/RF-5606


      However I'm stuck with this code (it's inside a dataTable):

      <a4j:commandLink value="del" actionListener="#{blogEdit.doDeleteComment}" onclick="if (! window.confirm('Are you sure?') ) {return false}" reRender="comments">
       <f:setPropertyActionListener value="#{comment}" target="#{blogEdit.editedComment}" />
      </a4j:commandLink>



      I cannot use:
      a4j:actionparam name="comment" value="#{comment}" assignTo="#{blogEdit.editedComment}" actionListener="#{blogEdit.doDeleteComment}"/>

      because my object is not easily serializable.


      Does annyone have a workaround giving a way to trigger a listener after a setPropertyActionListener has ben triggered?

      Thanks.

        • 1. Re: a4j:commandButton and f:stPropertyActionListener
          fabmars

          Hmmmwell this seems to work:

          <a4j:commandLink value="del" onclick="if (! window.confirm('Are you sure?') ) {return false}">
           <f:setPropertyActionListener value="#{comment}" target="#{blogEdit.editedComment}" />
           <a4j:support event="onbeforedomupdate" actionListener="#{blogEdit.doDeleteComment}" reRender="comments"/>
          </a4j:commandLink>


          • 2. Re: a4j:commandButton and f:stPropertyActionListener
            ilya_shaikovsky

            about the case you marked as working - it looks not really good because two requests risen instead of one.

            about the case itself - I think you should check the problem at JSF resources because the sequence will be the same if you will not use a4j:command* controls but use h:command* instead.

            • 3. Re: a4j:commandButton and f:stPropertyActionListener
              fabmars

              Sorry for letting the doubt: it is totally right that the result will be the same with h:command*, and I wasn't looking trying to decribe a potential bug. If I had to, I'd be more specific.

              I was looking for a workaround. And I'm still looking for a simple one. I can always assign the property by code inside my listener but it will force me to do some tricks.


              I can always ask the JSF people, but judging by the way JSF 1.2 handles actions, it's just to no avail.