Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4730

Filter component does not clear filter fields

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.0.0-beta3
    • Fix Version/s: 6.1.0
    • Component/s: wicket-extensions
    • Labels:
      None

      Description

      The GoAndClearFilter.onClearSubmit() does not clear filter fields because the originalState member has the current values of the filter. I think it should create a new instance of the originalState class instead of clone the model.

      To verify use the phonebook sample (https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/phonebook). The clear only works if "go" was not pressed after enter some values in the filter, but if you press go and then want to clear the filter it keeps the values.

      Attached is a patch that makes the phonebook sample work.

      It might also be useful if the originalState attribute were made protected or accessible via protected method to allow users to overwrite the onClearSubmit() method and access the originalState attribute.

        Attachments

        1. commit-347c459
          1 kB
          Andreas Kuhtz

          Activity

            People

            • Assignee:
              mgrigorov Martin Grigorov
              Reporter:
              akuhtz Andreas Kuhtz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: