
| Key: |
DISPL-69
|
| Type: |
Improvement
|
| Status: |
Closed
|
| Resolution: |
Fixed
|
| Priority: |
Critical
|
| Reporter: |
Dan Allen
|
| Votes: |
0
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
|
Issue Links:
|
dependent
|
|
This issue depends upon:
|
|
DISPL-58
Additional attribute for specifying property used for sorting.
|
|
|
|
|
|
|
|
|
Often times it is necessary to allow for a conditional use of the href attribute on a column (creating a link, or not creating a link, based on the contents of the column). However, if the link is created manually inside the contents of the column tag (as opposed to using the href attribute on the column) the sorting functionality is affected because it now includes the html markup in the value of each column.
Example:
<display:column property="id" sortable="true">
<c:if test="${not empty row.id}"><html:link action="ViewItem?id=${row.id}"><c:out value="${row.name}"/></c:if>
<c:if test="${empty row.id}">[empty]</c:if>
</display:column>
Output:
<a href="/app/ViewItem?id=6">Mountain Bike</a>
[empty]
<a href="/app/ViewItem?id=3">Canoe</a>
<a href="/app/ViewItem?id=8">Tent</a>
[empty]
The problem with the above code is that the sort will actually occur on the value of the id rather than the name. However, since the end user sees a name in the column, that person would expect it to be sorting on name. Under no circumstance would a sort on the url be desirable.
|
|
Description
|
Often times it is necessary to allow for a conditional use of the href attribute on a column (creating a link, or not creating a link, based on the contents of the column). However, if the link is created manually inside the contents of the column tag (as opposed to using the href attribute on the column) the sorting functionality is affected because it now includes the html markup in the value of each column.
Example:
<display:column property="id" sortable="true">
<c:if test="${not empty row.id}"><html:link action="ViewItem?id=${row.id}"><c:out value="${row.name}"/></c:if>
<c:if test="${empty row.id}">[empty]</c:if>
</display:column>
Output:
<a href="/app/ViewItem?id=6">Mountain Bike</a>
[empty]
<a href="/app/ViewItem?id=3">Canoe</a>
<a href="/app/ViewItem?id=8">Tent</a>
[empty]
The problem with the above code is that the sort will actually occur on the value of the id rather than the name. However, since the end user sees a name in the column, that person would expect it to be sorting on name. Under no circumstance would a sort on the url be desirable. |
Show » |
|
DISPL-58stripping html during sorting could be really slow: the added sortProperty attribute should provide the same functionality with a lower overhead