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

Remove ISortStateLocator.setSortState() method.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 1.5-RC2
    • 1.4.18, 1.5-RC4
    • wicket-extensions
    • None
    • all

    Description

      Can we please drop the setSortState() method of org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator ? It's not used by anything at all, and just messes my data provider up.

      My ISortableDataProvider expects my custom ISortState, which is fine, except that I must allow someone to setSortState() passing me a generic ISortState, which will not work with my Data Provider. I think this setSortState() is unnecessary and should be dropped.

      <martin-g> the idea is that you can change the sortState after construction

      yes, but ISortState has a setPropertySortOrder(), which allows it to be mutable, hence no need to provice a new ISortState

      My use case is this: I have a MultiColumnSortState, which maintains a List of SortParams, based on the sequence of setPropertySortOrder() calls. My ISortableDataProvider can only intelligently work with this one ISortState it is designed to work with.

      Setting another arbitrary ISortState will make no sense. In fact, look at the only ISortableDataProvider supplied with Wicket source: org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider. It too can only accept the specific ISortState it expects. That ISortState is also mutable, so does not actually need setting at all.

      Attachments

        1. fix-WICKET-3580.patch
          2 kB
          Jesse Long

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            jesselong Jesse Long
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: