Change your table to use an ISortableDataProvider and define your default
sort order.
http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/extensions/markup/html/repeater/data/table/ISortableDataProvider.html

~ Thank you,
   Paul Bors


On Fri, Jun 14, 2013 at 11:42 AM, Steve Lowery
<[email protected]>wrote:

> Is there an easy way to have a DataTable column sort descending the first
> time it is clicked on?  The code in OrderByLink does the following:
>
> protected SortOrder nextSortOrder(final SortOrder order)
> {
> // init / flip order
> if (order == SortOrder.NONE)
> {
> return SortOrder.ASCENDING;
> }
> else
> {
> return order == SortOrder.ASCENDING ? SortOrder.DESCENDING :
> SortOrder.ASCENDING;
> }
> }
>
> The first time it is NONE, so it changes to ASCENDING.  This is the desired
> outcome in most use cases, but not one I am working on.  I think I can
> override this, but it's ugly since I'd have to go through
> OrderByLinkBorder, HeadersToolbar and to Datatable.  Just wondering if
> there's a cleaner and/or easier way.
>
> --
>
>
> IMPORTANT: This e-mail (including any attachments) is intended for the use
> of the individual or entity to which it is addressed and may contain
> information that is classified, private, or confidential. If the reader of
> this message is not the intended recipient, or the employee or agent
> responsible for delivering the message to the intended recipient, you are
> hereby notified that any dissemination, distribution, or copying of this
> communication is prohibited. If you have received this communication in
> error, please notify us immediately by replying to this e-mail. Thank you.
>

Reply via email to