quinquin2209 wrote:
I have just downloaded the DisplayTag and try with the sort function. I do
the following:

<display:table name="messages" sort="list" pagesize="8">
    <display:column property="docId" title="ID" group="1" sortable="true"
headerClass="sortable" />
    <display:column property="sender" title="Sender" group="2"
sortable="true" headerClass="sortable" />
 </display:table>

When I click on the column header, it displays "Nothing found to display".
The URL has been changed to
http://localhost:8080/test/jsp/folderList.jsp?d-49653-s=0&d-49653-o=2&d-49653-p=1

My folderList.jsp is actually called up through the URL: http://locahost:8080/test/Folder/list.action
as defined in the struts.xml. How can I do such that the sorting can be done
as expected?



Assuming the JSP above is the result of executing list.action:

First, remove your sort="list" attribute, then set the requestURI attribute of <display:table> to "" (blank). This will make it reuse the same action that loaded it and will sort the values by the selected column. It usually works immediately.

<display:table name="messages" requestURI="" pagesize="8">


The purpose of DisplayTag's sort attribute is to provide external sorting. DisplayTag is just fine with strings, numbers and links. External sorting is necessary only if you can't allow it to call the same action. For more information about that see http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html

You'll find a lot of good prior discussions about using displaytag with struts2 in this group.
regards,
Jeromy Evans

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to