Hi Lucio,

I like the idea of 3 states, ascending, descending and none for each column. You will need to create a new interface that extends ISortableDataProvider which provides a default sort order for when the user deselects all columns (you must always have some sort order, so when the user deselects all sorting, fall back to default).

All of this would not be possible with the existing header toolbar, but it would not be too difficult to implement an extended header toolbar to know about multiple sort columns, and render the sort state/priority of the column. I do think however that your header would be very "busy".

How often are your users actually going to want to order by multiple fields? A hybrid approach might work better - normal single sort state from clicking on headers, or expand collapsible palette for complex sorting as is needed the added benefit here is that you can add features like add remove and reorder columns in this panel. I use a collapsible panel for filtering and it seems to work quite nicely.

Cheers,
Jesse

On 30/04/2013 19:44, Lucio Crusca wrote:
In data Tuesday 30 April 2013 19:14:12, Jesse Long ha scritto:
Hi Lucio,

Its something I'd be interested in pursuing myself, but the real problem
is how to display the sort state to the user.
How about this?

<ascii-art font="monospaced">

|         |        ^ |         ^ |               |
| Name  2 | Color  3 | Price     | Available   1 |
|       v |          |         v |             v |

</ascii-art>


That would mean the primary sorting is by availability descending (1), then by
name (2) descending and finally by color (3) ascending. Price is unsorted.
Clicking a column, instead of only toggling direction, could switch between
ascending, descending and unsorted. Clicking unsorted columns could make them
be the primary sort column and shift other sort columns priority by 1.

A more intuitive alternative would be to make the single arrows clickable, in
addition to columns names, and clicking columns names would only toggle
between sorted/unsorted states, with unsorted->sorted transition moving the
column to the primary sort criteria as above.

Would it be hard to obtain that with current wicket components?

You could use a Palette type component as a top toolbar, allowing the
user to add from available columns in the left to the sort columns in
the right, and sort them in the order that they were added to the right
hand side of the palette.
That's another way to do it. I don't like it very much to be honest, but I
guess it's only a matter of taste.

You dont need to use SortableDataProvider (which supports
SingleSortState), you can use any subclass of ISortableDataProvider and
you can support whatever ISortState you want.
Thanks for the hint, I hadn't realized that before.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to