7 Replies Latest reply on Mar 5, 2013 1:13 PM by Nooruddin Shaik

    FormHandler Chaining

    993799
      In our site we have already implemented Checkout Process (Shipping --> Billing ---> PlaceOrder) and we are planning to implement One Page Checkout, is it ok to reuse both extended (Shipping and Payment) formHandler in single Formhandler by the way of calling the handle methods of shipping and Payment, to place the Order?

      Thanks
        • 1. Re: FormHandler Chaining
          Praveer.Rai
          Even in one page , you can use multiple forms for different formhandlers for each section of details that you ask user during checkout.

          This is more structured and it will be easier for you to validate data during checkout.

          ```
          Praveer
          • 2. Re: FormHandler Chaining
            Nooruddin Shaik
            Though you can use different form beans in single page but there should be only one handle method getting called.
            From the question it looks that you want to use different handle methods which will not work the way you expect.
            Each handle method will have its own validations and does a redirect. So other handle method will not be called.

            The error messages are tied to formhandler, then you need to iterate over both the formhandlers and display.
            The success page redirection cannot happen from both the handle methods.

            This approach is not recommended and need to customize the formhandles to have this chaining.
            Have one handle method and call the corresponding manager classes.

            Peace
            Shaik
            1 person found this helpful
            • 3. Re: FormHandler Chaining
              Praveer.Rai
              Hi Shaik ,

              I think it also depends on UI , suppose we have submit/continue button on each panel ( billing panel , shipping panel ) , then we can invoke individual form handlers and then either refresh the page or use ajax to decide what to do next - show error or allow user to fill next panel.

              In case there is only one button on page - then whatever you are suggesting is fine.

              Please correct me if wrong.

              ```
              Praveer
              • 4. Re: FormHandler Chaining
                Samdani Gulam
                i believe all your business logic would not be in any of the existing FormHandlers, they would have called some Managers classes to do the job.
                My suggestion would be to create a single Form hanlder and then invoke methods on the existing manager classes, Form Handler chaining would be bad design.
                • 5. Re: FormHandler Chaining
                  Nooruddin Shaik
                  In that case these are two different forms and each is handled individually from client.

                  This is not formhandler chain like pipeline chains.

                  Peace
                  Shaik
                  • 6. Re: FormHandler Chaining
                    RMishra
                    This is not formhandler chain like pipeline chains.
                    Hi Shaik, I never found term like "formhandler chaining/chain" in oracle doc and google search.
                    Can you please elaborate this term?

                    -RMishra
                    • 7. Re: FormHandler Chaining
                      Nooruddin Shaik
                      The question was to implement the formhandler chaining to call both the handle methods as part of one request.

                      Peace
                      Shaik