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

Filter component does not clear filter fields

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 6.0.0-beta3
    • 6.1.0
    • wicket-extensions
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: