4 Replies Latest reply on Jun 6, 2011 9:20 AM by dpacifico

    Double submit prevent support ?

    sudda_1

      How to handle double submit issue in RichFaces facelet page ?

       

      - Sudda

        • 1. Double submit prevent support ?
          ilya40umov

          Hm. Out of curiosity, what is the "double submit issue"?

          • 2. Double submit prevent support ?
            sudda_1

            Sorry for not making "double submit issue" clear. (Maybe it can also be called "multiple" submits)

             

            There are 3 scenarios "double submit" can happen:

             

            1) Reloading page that was loaded using a post(by clicking F5 button for example).

            2) Clicking browser "Back" button to go to page that was loaded by a post.

            3) Submiting a form(POST request) and then clicking "submit" multiple times before request is returned.

             

            Double submit scenario's can be "issue" in following classical example:

            1) POST request performs "credit amount" operation on a bank account.

             

            You would not want above to be posted repeatedly.

             

            Can you please let me know if any RichFace componenet helps to prevent this issue.

            Or if we have to implement this on our own any pointers will be much appreciated.

            • 3. Double submit prevent support ?
              ilya_shaikovsky

              you could:

              1.1) block the UI by the modal popup for critical submit buttons

              or

              1.2) disable the buttons right after first click via JS and enable only when responce returned (for h: one enablling will be automaticall)

               

              2) prevent the concurrent requests additionally by using a4j:queue.

              • 4. Re: Double submit prevent support ?
                dpacifico

                The same problem happened to me. It always happens when the attribute "process" of my a4j button has the panel that include the button or the button itself. When i not include the button in the "process" attribute all works fine to me.