use of org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider in project midpoint by Evolveum.
the class ContainerableListPanel method setDefaultSorting.
protected void setDefaultSorting(ISelectableDataProvider<C, PO> provider) {
if (provider instanceof SortableDataProvider && isCollectionViewPanel() && getObjectCollectionView().getPaging() != null && getObjectCollectionView().getPaging().getOrderBy() != null) {
PagingType paging = getObjectCollectionView().getPaging();
boolean ascending = !OrderDirectionType.DESCENDING.equals(paging.getOrderDirection());
ItemPath orderBy = paging.getOrderBy().getItemPath();
ItemName name = orderBy.lastName();
if (name == null) {
return;
}
((SortableDataProvider) provider).setSort(new SortParam(name.getLocalPart(), ascending));
}
}
Aggregations