3 Replies Latest reply on Aug 18, 2015 6:55 AM by michpetrov

    a4j:form replacement in richfaces 4.7.3

    krk12

      Hello,

       

      In my xhtml, I have a4j:form which contains a4j:commandLink and a4j:commandButton of type="submit". When there is some changes done on the page and any of the commandLinks are clicked, the onsubmit attribute of a4j:form invokes a script function (A browser popup is used). Based on the output provided on this popup, the changes are either retained or discarded.

       

      Now I have upgraded richfaces to version 4.7.3. In this a4j:form is removed and the replacement mentioned for this is h:form. Along with this change, the links and buttons have to be changed to h:commandLinks and h:commandButtons. With these changes I am able to invoke the onsubmit action. But the problem that I am facing is that the a4j:status of the commandLinks and commandButtons are not working anymore.

       

      Is there any way for me to retain the a4j commandLink and commandButton along with h:form and produce the desired functionality? I need this to invoke the onsubmit function as well as the a4j:status actions.

       

      Any help is highly appreciated!

       

      Best Regards!

        • 1. Re: a4j:form replacement in richfaces 4.7.3
          michpetrov

          Why do you need to change the a4j:commandButton? If you want to use a4j:status you need to use an a4j component, other components cannot set the status.

          • 2. Re: a4j:form replacement in richfaces 4.7.3
            krk12

            I had to change a4j:commandLink to h:commandLink because the onsubmit function of h:form was not getting invoked when a4j:commandLink was clicked. With this change, the onsubmit function is getting invoked but like you have mentioned a4j:status is not working.

             

            Is there any way I can use both the functionalities i.e., ensure that the onsubmit as well as the a4j:status works hand in hand?

            • 3. Re: a4j:form replacement in richfaces 4.7.3
              michpetrov

              Ah ok. AJAX requests do not submit the form so you cannot listen to the onsubmit event and submitting the form would mean the whole page gets reloaded so a4j:status would be useless anyway. To prevent the submission use onclick of the commandButton.