Menu

sorting with links - need answers..

Help
2008-09-26
2012-10-09
  • Joshua Toepfer

    Joshua Toepfer - 2008-09-26

    Here is what I am running into...

    <h3>Code</h3>:

    <display:table>
    <display:column title="Person Name" sortable="true">
    <html:link action="/myaction?id=${uid.id}&nav=open" >${uid.name}</html:link>
    </display:column
    </display:table>

    Now the above code generates exactly what I want.

    <h3>Output</h3>:

    <table>
    <tr>
    <th><a href="/myaction.do?d-1345720-p=1&amp;d-1345720-s=1&amp;d-1345720-o=2">Person Name</th>
    </tr>
    <tr>
    <td><a href="/myaction.do?id=11&nav=open">John Doe</a><td>
    </tr>
    </table>

    <h3>Problem</h3>:

    However, when I sort on the Person Name column, the order is not in the order of the actual value, but instead it gets ordered
    by the <a href=".."> tag. So, if I have a person's name that is William but his id is 1 and Smith id is 2 then William will show up
    before Smith.

     
    • Joshua Toepfer

      Joshua Toepfer - 2008-09-26

      I have been using displaytag for a while and have been using the property which must default to the sorting field if no sortProperty is given. The reason was asking I am acutally using a custom jsp tag, to combine fields and the property does not allow this. From now on sortProperty it is...

      thanks
      Whiskogs

       
    • Whiskogs

      Whiskogs - 2008-09-26

      Howdy,

      From what I read, it seems similar to what I encountered last year. Here's the thread in question: https://sourceforge.net/forum/forum.php?thread_id=1890052&forum_id=249318
      The solution was to use the sortProperty property, but you can get a more detailed explanation if you follow the above link.

      kr,

       
    • Whiskogs

      Whiskogs - 2008-09-26

      *sortProperty attribute, of course.

       

Log in to post a comment.