Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-1198

problem with Checkbox + custom validators

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.1.2
    • Component/s: Framework
    • Labels:
      None

      Description

      I have a Checkbox component which has a custom validator. The validator requires the checkbox to be in checked state under certain circumstances.

      My problem is the following:
      1. the checkbox is checked
      2. the user unchecks it and submits the form
      3. after the resulting page is rendered, the validation message is rendered as expected BUT the checkbox will be checked!

      The cause of the problem is that Checkbox doesn't record the newly submitted value in the validation delegate.
      For example TextField does this task indirectly by calling TranslatedFieldSupport.parse(), and the recorded value is read indirectly by TranslatedFieldSupport.format().

      Proposed solution: call the delegate's getFieldInputValue() and recordFieldInputValue() methods.

      Regards:
      Norbi

      1. Checkbox.patch
        1 kB
        Norbert Sándor

        Activity

        Hide
        snorbi Norbert Sándor added a comment -

        patch of my implementation

        Show
        snorbi Norbert Sándor added a comment - patch of my implementation
        Hide
        jkuhnert Jesse Kuhnert added a comment -

        Applied. (though it was done slightly differently )

        Show
        jkuhnert Jesse Kuhnert added a comment - Applied. (though it was done slightly differently )

          People

          • Assignee:
            jkuhnert Jesse Kuhnert
            Reporter:
            snorbi Norbert Sándor
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development