// set the table model to perform in memory local sorting
this.tableModel.setLocalSort(this.localSort && (this.paginatedList == null));
HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();
RequestHelper requestHelper = rhf.getRequestHelperInstance(this.pageContext);
initHref(requestHelper);
Integer pageNumberParameter = getFromRequestOrSession(request, requestHelper, TableTagParameters.PARAMETER_PAGE);
this.pageNumber = (pageNumberParameter == null) ? 1 : pageNumberParameter.intValue();
int sortColumn = -1;
if (!this.tableModel.isLocalSort())
{
// our sort column parameter may be a string, check that first
String sortColumnName = requestHelper.getParameter(encodeParameter(TableTagParameters.PARAMETER_SORT));
// if usename is not null, sortColumnName is the name, if not is the column index
String usename = requestHelper.getParameter(encodeParameter(TableTagParameters.PARAMETER_SORTUSINGNAME));
if (sortColumnName == null)
{
this.tableModel.setSortedColumnNumber(this.defaultSortedColumn);
}
else
{
if (usename != null)
{
this.tableModel.setSortedColumnName(sortColumnName); // its a string, set as string
}
else if (NumberUtils.isNumber(sortColumnName))
{
sortColumn = Integer.parseInt(sortColumnName);
this.tableModel.setSortedColumnNumber(sortColumn); // its an int set as normal
}
}
}
else if (this.paginatedList == null)
{
Integer sortColumnParameter = getFromRequestOrSession(
request,
requestHelper,
TableTagParameters.PARAMETER_SORT);
sortColumn = (sortColumnParameter == null) ? this.defaultSortedColumn : sortColumnParameter.intValue();
this.tableModel.setSortedColumnNumber(sortColumn);
}
else
{
sortColumn = defaultSortedColumn;
}
// default value
boolean finalSortFull = this.properties.getSortFullList();
// user value for this single table
if (this.sortFullTable != null)
{
finalSortFull = this.sortFullTable.booleanValue();
}
// if a partial list is used and sort="list" is specified, assume the partial list is already sorted
if (!this.partialList || !finalSortFull)
{
this.tableModel.setSortFullTable(finalSortFull);
}
if (this.paginatedList == null)
{
SortOrderEnum paramOrder = SortOrderEnum.fromCode(getFromRequestOrSession(
request,
requestHelper,
TableTagParameters.PARAMETER_ORDER));
// if no order parameter is set use default
if (paramOrder == null)
{
paramOrder = this.defaultSortOrder;
}
boolean order = SortOrderEnum.DESCENDING != paramOrder;
this.tableModel.setSortOrderAscending(order);
}
else
{
SortOrderEnum direction = paginatedList.getSortDirection();
this.tableModel.setSortOrderAscending(direction == SortOrderEnum.ASCENDING);
}
Integer exportTypeParameter = requestHelper
.getIntParameter(encodeParameter(TableTagParameters.PARAMETER_EXPORTTYPE));
this.currentMediaType = ObjectUtils.defaultIfNull(
MediaTypeEnum.fromCode(exportTypeParameter),
MediaTypeEnum.HTML);