Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.1.1
-
Fix Version/s: 1.1.1
-
Component/s: Paging/Sorting
-
Labels:None
-
Application server:Tomcat 5.5
Description
I created a column called "Document Title". I created a Table Decorator so I could wrap a URL around the data (since the current linking implementation does not support target="" in the hyperlink).
Example Decorator:
public String getDocumentTitle() {
Row currentRow = (Row)getCurrentRowObject();
String pidString = currentRow.getPidString();
String documentTitle = currentRow.getDocumentTitle();
return "<a href=\"/BPView/docOpener.jsp?pid=" + pidString + "\" target=\"_blank\" class=\"doclinks\"><nobr>" + documentTitle + "</nobr></a>";
}
After doing this, the column no longer sorted on the data that was in my "documentTitle" property, instead it sorted on the TEXT that was put into the documentTitle after the decorator had been applied - so effectively I was sorting on "pidString" instead.
Note that in the current URL linking mechanism, applying a URL does not alter the Sorting. It still sorts on the data from the column instead of the URL that was wrapped around the hyperlink.
Similarly, adding a decoration to a column should not have an effect on the sort. Perhaps there could be an optional parameter sortOnDecoratedColumn or something which would allow you to specify to sort on the actual data or the "decorated data" for the column.
Example Decorator:
public String getDocumentTitle() {
Row currentRow = (Row)getCurrentRowObject();
String pidString = currentRow.getPidString();
String documentTitle = currentRow.getDocumentTitle();
return "<a href=\"/BPView/docOpener.jsp?pid=" + pidString + "\" target=\"_blank\" class=\"doclinks\"><nobr>" + documentTitle + "</nobr></a>";
}
After doing this, the column no longer sorted on the data that was in my "documentTitle" property, instead it sorted on the TEXT that was put into the documentTitle after the decorator had been applied - so effectively I was sorting on "pidString" instead.
Note that in the current URL linking mechanism, applying a URL does not alter the Sorting. It still sorts on the data from the column instead of the URL that was wrapped around the hyperlink.
Similarly, adding a decoration to a column should not have an effect on the sort. Perhaps there could be an optional parameter sortOnDecoratedColumn or something which would allow you to specify to sort on the actual data or the "decorated data" for the column.
If that solves your problem, please close this issue