Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.2.0
    • Component/s: core
    • Labels:
      None

      Description

      One area where Click can improve is supporting dynamic forms. Typical example is registering JavaScript events on Fields to submit the Form and then add more Fields as the user navigates the Form.

      Couple of reasons make this problematic. Form automatically validates its fields. One can switch off this validation but need to keep in mind to switch validation back on for non JS submissions.

      The other area which is tricky is that all dynamic fields must be added in the Page onInit event in order to be processed properly. One can invoke field.bindRequestValue to query the field's value, but bindRequestValue doesn't properly check whether or not its parent Form was submitted.

      I propose we add a couple of helper methods to Form and Field to make this process smoother eg:

      void field.bind();
      boolean field.bindAndValidate(); <- will return true if the field is valid, false otherwise

      form.bindFields();
      boolean form.bindAndValidateFields(); <- will return true if all fields are valid, false otherwise

        Activity

        Hide
        Bob Schellink added a comment -

        done

        Show
        Bob Schellink added a comment - done
        Hide
        Andrei Ionescu added a comment -

        Please add this functionality to FormTables too:
        https://issues.apache.org/jira/browse/CLK-645

        Show
        Andrei Ionescu added a comment - Please add this functionality to FormTables too: https://issues.apache.org/jira/browse/CLK-645
        Hide
        Malcolm Edgar added a comment -

        I think this is probably a good approach.

        regards Malcolm Edgar

        Show
        Malcolm Edgar added a comment - I think this is probably a good approach. regards Malcolm Edgar
        Hide
        Bob Schellink added a comment -

        Instead of cluttering Form/Field we could add bind helper methods to ClickUtils instead...

        Show
        Bob Schellink added a comment - Instead of cluttering Form/Field we could add bind helper methods to ClickUtils instead...

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development