Wicket
  1. Wicket
  2. WICKET-4730

Filter component does not clear filter fields

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major 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.

      1. commit-347c459
        1 kB
        Andreas Kuhtz

        Activity

        Emond Papegaaij made changes -
        Fix Version/s 6.1.0 [ 12322957 ]
        Fix Version/s 6.0.1 [ 12322956 ]
        Martin Grigorov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Martin Grigorov [ mgrigorov ]
        Fix Version/s 6.0.1 [ 12322956 ]
        Resolution Fixed [ 1 ]
        Andreas Kuhtz made changes -
        Field Original Value New Value
        Attachment commit-347c459 [ 12542261 ]
        Andreas Kuhtz created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development