[
https://issues.apache.org/jira/browse/WICKET-1195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587803#action_12587803
]
Roy van Rijn commented on WICKET-1195:
--------------------------------------
What do you want exacly? Its not 100% clear to me yet.
Something like this:
public final OrderByLink sort()
{
int oldDir = state.getPropertySortOrder(property);
int newDir = ISortState.ASCENDING;
if (oldDir == ISortState.ASCENDING)
{
newDir = ISortState.ASCENDING;
}
return sort(ISortState.ASCENDING);
}
public final OrderByLink sort(int direction)
{
if(startWith!=ISortState.ASCENDING && startWith!=ISortState.DESCENDING)
{
// throw IllegalArgument
}
if (isVersioned())
{
// version the old state
Change change = new SortStateChange();
addStateChange(change);
}
state.setPropertySortOrder(property, direction);
return this;
}
Or when you create a OrderByLink you give the default first sort-state, like
this:
int firstSort= ISortState.DESCENDING;
OrderByLink(id, property, stateLocator, firstSort);
(then when you sort it goes from NONE to DESCENDING first)
> Let the user choose the default sorting of OrderByLink
> ------------------------------------------------------
>
> Key: WICKET-1195
> URL: https://issues.apache.org/jira/browse/WICKET-1195
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.3.0-rc1
> Reporter: Thomas Jaeckle
> Priority: Minor
> Fix For: 1.5-M1
>
>
> currently sort() in OrderByLink looks like that:
> public final OrderByLink sort()
> {
> if (isVersioned())
> {
> // version the old state
> Change change = new SortStateChange();
> addStateChange(change);
> }
> ISortState state = stateLocator.getSortState();
> int oldDir = state.getPropertySortOrder(property);
> int newDir = ISortState.ASCENDING;
> if (oldDir == ISortState.ASCENDING)
> {
> newDir = ISortState.DESCENDING;
> }
> state.setPropertySortOrder(property, newDir);
> return this;
> }
> So by default the sorting is always ISortState.ASCENDING when you click on a
> OrderByLink that had an ISortState.NONE state before.
> I would like to set the default sorting by myself (in the case I have, I want
> DESCENDING as default sorting).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.