listParameters = new ValueListParameters(ValueListConstants.OPPORTUNITY_LIST_TYPE, listPreference.getRecordsPerPage(), 1);
} else { // paging or sorting or something, use the parameters from the request.
listParameters = requestListParameters;
}
if (listParameters.getSortColumn() == 0) {
FieldDescriptor sortField = (FieldDescriptor)ValueListConstants.opportunityViewMap.get(listPreference.getSortElement());
listParameters.setSortColumn(sortField.getQueryIndex());
if (listPreference.getsortOrder()) {
listParameters.setSortDirection("ASC");
} else {
listParameters.setSortDirection("DESC");