0

How to sort the column using displaytag in java my code is as follows:

<display:column property="bulk" title="User Name" sortable="false"/>
<display:column   title="File Name" >
    <c:url value="../BulkHistoryDetails" var="url">
    <c:param name="ID" value="${row.bulk}"/>
    <c:param name="FileName" value="${row.filename}"/>
    </c:url>
    <a href=${url}>${row.filename}</a> 
   </display:column>

i want to sort filename column which is having values like PJ00xxxx Data for Usage 32013-02-18_04-50-47.xls and if click on filename it is going to other jsp. as it is already have hiperlink i am not able to use sorttabe=true as if i click on file name header it goes to another jsp not sorting .please advise.

bsiamionau
  • 8,099
  • 4
  • 46
  • 73
user2083356
  • 125
  • 1
  • 9

1 Answers1

0

You should probably post your entire display tag code starting with <display:table name="fileList">.

It sounds like you want the column heading to function as a sort button when you click on it and for the data within that column to function as hyperlinks. I don't see why this should be a problem. When you add the sortabler="true" attribute to the "File Name" column it turns the column heading into a hyperlink? Really? What does it link to?

If the column heading does somehow become a hyperlink then you can try a creating a link from the row column data using a Table Decorator or the href attribute, both described here: display tag docs. I think either of these approaches results in a cleaner solution than what you have now.

Thorn
  • 4,015
  • 4
  • 23
  • 42
  • What happens to the column heading when you use sortable="true" for that column? What does it link to? – Thorn Feb 18 '13 at 14:24
  • when i add sortable="true" it link to my servlet which i mention in c:url – user2083356 Feb 18 '13 at 14:36
  • What id and filename parameters are passed? I'm assuming row is your row variable referencing some FileObject. What value is row.filename when you are not on a row? – Thorn Feb 18 '13 at 14:39