Index: src/main/java/org/displaytag/render/HtmlTableWriter.java
===================================================================
--- src/main/java/org/displaytag/render/HtmlTableWriter.java (revision 1133)
+++ src/main/java/org/displaytag/render/HtmlTableWriter.java (working copy)
@@ -542,11 +542,7 @@
href.removeParameter(properties.getPaginationPageNumberParam());
}
- String sortProperty = headerCell.getSortProperty();
- if (sortProperty == null)
- {
- sortProperty = headerCell.getBeanPropertyName();
- }
+ String sortProperty = headerCell.getSortParameterValue();
href.addParameter(properties.getPaginationSortParam(), sortProperty);
String dirParam;
Index: src/main/java/org/displaytag/model/HeaderCell.java
===================================================================
--- src/main/java/org/displaytag/model/HeaderCell.java (revision 1133)
+++ src/main/java/org/displaytag/model/HeaderCell.java (working copy)
@@ -322,6 +322,23 @@
}
/**
+ * Look for the parameter value used to indicate that this column is sorted by searching
+ * the sortName, sortProperty, and beanPropertyName properties in that order.
+ */
+ public String getSortParameterValue() {
+ String sortProperty = getSortName();
+ if (sortProperty == null)
+ {
+ sortProperty = getSortProperty();
+ }
+ if (sortProperty == null)
+ {
+ sortProperty = getBeanPropertyName();
+ }
+ return sortProperty;
+ }
+
+ /**
* Gets the column title.
* @return the column title. If no title is specified the capitalized bean property name is returned
*/
Index: src/main/java/org/displaytag/model/TableModel.java
===================================================================
--- src/main/java/org/displaytag/model/TableModel.java (revision 1133)
+++ src/main/java/org/displaytag/model/TableModel.java (working copy)
@@ -412,7 +412,7 @@
else
{
// the sorted parameter was a string so try and find that column name and set it as sorted
- if (this.sortedColumnName.equals(headerCell.getSortName()))
+ if (this.sortedColumnName.equals(headerCell.getSortParameterValue()))
{
headerCell.setAlreadySorted();
}
Index: src/main/java/org/displaytag/tags/TableTag.java
===================================================================
--- src/main/java/org/displaytag/tags/TableTag.java (revision 1133)
+++ src/main/java/org/displaytag/tags/TableTag.java (working copy)
@@ -679,11 +679,7 @@
{
String sortCriterion = paginatedList.getSortCriterion();
- String sortProperty = column.getSortProperty();
- if (sortProperty == null)
- {
- sortProperty = column.getBeanPropertyName();
- }
+ String sortProperty = column.getSortParameterValue();
if ((sortCriterion != null) && sortCriterion.equals(sortProperty))
{
@@ -942,6 +938,10 @@
this.paginatedList = (PaginatedList) this.list;
this.list = this.paginatedList.getList();
}
+ else
+ {
+ this.paginatedList = null;
+ }
// set the table model to perform in memory local sorting
this.tableModel.setLocalSort(this.localSort && (this.paginatedList == null));