Just for the records ... I managed to have it working so displaytag
re-sorts the last user selection whenever the AJAX DIV refreshes. It
works using the includeParams option set to "get":
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<s:url id="jobStatus" includeParams="get"
value="/RefreshOptimizationJobStatus.action" />
<s:div id="jobStatus" theme="ajax" href="%{jobStatus}" updateFreq="3000"
indicator="indicator" />
<img id="indicator" src="img/indicator.gif" alt="Loading..."
style="display:none" />
The result of RefreshOptimizationJobStatus.action is this jsp:
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
request.setAttribute("decorator", "none");
response.setHeader("Cache-Control","no-cache"); // HTTP 1.1
response.setHeader("Pragma","no-cache"); // HTTP 1.0
response.setDateHeader ("Expires", 0); //
prevents caching at the proxy server
%>
<display:table name="applicationScope.jobStatus"
defaultorder="descending" pagesize="10"
requestURI="/ListDisplayOptimizationJobStatus.action" export="true"
sort="list"
decorator="com.sag.optimizer.ui.web.displaytag.decorator.OptimizationJobDecorator"
>
<display:column property="optimizationRunId" title="ID"
sortable="true" headerClass="sortable" />
<display:column property="historicBook0" title="Book 1"
sortable="true" headerClass="sortable" />
<display:column property="historicBook1" title="Book 2"
sortable="true" headerClass="sortable" />
<display:column property="priority" title="Priority"
sortable="true" headerClass="sortable" />
<display:column property="permanent" title="Permanent"
sortable="true" headerClass="sortable" />
<display:column property="status" title="Status" sortable="true"
headerClass="sortable" />
<display:column property="progress" title="Progress"
format="{0,number,integer}%" sortable="true" headerClass="sortable" />
<display:column property="result" title="Result" sortable="false" />
</display:table>
regards,
Giovanni
Giovanni Azua wrote:
hi all,
I just put a displaytag table within a S2 AJAX DIV that refreshes
every X seconds. Now the problem is that I would like displaytag to
remember the last sorting options so e.g. the auto refresh not only
displays the new data but also resorts according to the last known
sorting criteria requested by the user.
The use case is a list of processes where the user can sort e.g.
progress then see which process moves to the top.
TIA.
Regards,
Giovanni
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]