Click
  1. Click
  2. CLK-279

Improve Form submit check to handle multiple forms per page

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The Form's javadoc states the following:

      Please Note the Form submit check currently only supports having one for per Page.

      This issue is to remove that restriction.

        Activity

        Hide
        Bob Schellink added a comment -

        Hi Malcolm

        When you have some time, can you review the patch please.

        Thanks

        Show
        Bob Schellink added a comment - Hi Malcolm When you have some time, can you review the patch please. Thanks
        Hide
        Malcolm Edgar added a comment -

        Patch looks good, and have checked this into SVN.

        I have tested this with one page, have you tried this with multiple forms? We will probably need to add an example page to click-examples.

        regards Malcolm Edgar

        Show
        Malcolm Edgar added a comment - Patch looks good, and have checked this into SVN. I have tested this with one page, have you tried this with multiple forms? We will probably need to add an example page to click-examples. regards Malcolm Edgar
        Hide
        Bob Schellink added a comment -

        I have tested this with two forms. Will also test with 2 forms and a tableForm.

        Show
        Bob Schellink added a comment - I have tested this with two forms. Will also test with 2 forms and a tableForm.
        Hide
        Malcolm Edgar added a comment -

        Hi Bob,

        Please resolve this item, when you are happy with your testing.

        regards Malcolm

        Show
        Malcolm Edgar added a comment - Hi Bob, Please resolve this item, when you are happy with your testing. regards Malcolm
        Hide
        Bob Schellink added a comment -

        Created an example with 2 forms and a formTable. Seems fine. Will upload this example under the "Forms" menu.

        Just wondering why you do not throw an IllegalArgumentException in performSubmitCheck(...) if name is null?

        If a nameless form calls onSubmitCheck the token would contain the null name. If multiple nameless forms called onSubmitCheck the tokens would clash in the session.

        Show
        Bob Schellink added a comment - Created an example with 2 forms and a formTable. Seems fine. Will upload this example under the "Forms" menu. Just wondering why you do not throw an IllegalArgumentException in performSubmitCheck(...) if name is null? If a nameless form calls onSubmitCheck the token would contain the null name. If multiple nameless forms called onSubmitCheck the tokens would clash in the session.
        Hide
        Malcolm Edgar added a comment -

        Hi Bob,

        Sounds like a good strategy. However, as the name is not an argument I would use an IllegalStateException.

        regards Malcolm

        Show
        Malcolm Edgar added a comment - Hi Bob, Sounds like a good strategy. However, as the name is not an argument I would use an IllegalStateException. regards Malcolm
        Hide
        Bob Schellink added a comment -

        I notice in the example (will commit it tomorrow) the value of both SUBMIT_CHECK HiddenFields are the same. Since the value is timestamp based both onSubmitChecks are called in the same millisecond.

        I doubt this is a problem since the SUBMIT_CHECK key is still unique to the page.

        Show
        Bob Schellink added a comment - I notice in the example (will commit it tomorrow) the value of both SUBMIT_CHECK HiddenFields are the same. Since the value is timestamp based both onSubmitChecks are called in the same millisecond. I doubt this is a problem since the SUBMIT_CHECK key is still unique to the page.
        Hide
        Bob Schellink added a comment -

        fixed will be available in Click1.4 RC3

        Show
        Bob Schellink added a comment - fixed will be available in Click1.4 RC3

          People

          • Assignee:
            Bob Schellink
            Reporter:
            Bob Schellink
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development