本文介绍了如何使用display:table将记录设置为最后一条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用display:table,只是为了显示标签.在我的场景中,我有7列.对于第一列,我在运行时获取值.例如,我的manualASNListUID.instanceType中有这些值,即arraylist(manualASNListUID)object(instanceType).列值是早期ASn",晚期ASn",总和".否则,则为早期ASn和Sum,否则为早期ASn,ASN晚期,CMMS和Sum.

I'm using a display:table, just to display tags. In my scenario I have 7 columns. For the first column, I get the values at runtime. For example I have these values in my manualASNListUID.instanceType that is an arraylist(manualASNListUID) and object(instanceType). The column values are Early ASn, Late ASn, Sum. Otherwise Early Asn and Sum or else Early ASn, Late ASn, CMMS and Sum.

如何设置总和"值显示在最后一行?

How can I set the 'Sum' values as display in the last row?

例如我的桌子:

Instance Type   Sep-23  Sep-16  Sep-09  Sep-02  Aug-26  Aug-19 
----------------------------------------------------------------------------
Early ASN        4        2      4        1       1       2 
Late ASN         2        1      5        3       1       1     
Sum              6        3      9        4       2       3 

Instance Type   Sep-23  Sep-16  Sep-09  Sep-02  Aug-26  Aug-19 
----------------------------------------------------------------------------
Early ASN        4        2      4        1       1       2 
Late ASN         2        1      5        3       1       1  
CMMS             0        0      0        0       0       0   
Sum              6        3      9        4       2       3

我的代码是:

<display:table name="${weeklyDlvyInstancesDashboardReportForm.manualASNListQO}" uid="manualASNListUID" sort="list" defaultsort="1" requestURI="/weeklyDlvyInstancesDashboardReportPre.do?method=httpGet" excludedParams="method" decorator="com.ford.mpl.superg.decorator.WeeklyDeliveryInstancesTypeTableDecorator" keepStatus="true">
    <%@include file="/jsp/include/displaytag.jsp"%>
    <c:set value="${manualASNListUID.firstWeekOfCountLabel}" var="manualASNFirstWeekOfCount"/>
    <c:set value="${manualASNListUID.secondWeekOfCountLabel}" var="manualASNSecondWeekOfCount"/>
    <c:set value="${manualASNListUID.thirdWeekOfCountLabel}" var="manualASNThirdWeekOfCount"/>
    <c:set value="${manualASNListUID.fourthWeekOfCountLabel}" var="manualASNFourthWeekOfCount"/>
    <c:set value="${manualASNListUID.fifthWeekOfCountLabel}" var="manualASNFifthWeekOfCount"/>
    <c:set value="${manualASNListUID.sixthWeekOfCountLabel}" var="manualASNSixthWeekOfCount"/>
    <c:if test="${(manualASNListUID.instanceType != null && manualASNListUID.instanceType ne 'Sum')}">
    <display:column property="instanceType" title="Instance Type" sortable="false"/>
    </c:if>
    <c:if test="${(manualASNListUID.instanceType != null && manualASNListUID.instanceType eq 'Sum')}">
    <display:column property="instanceType" title="Instance Type" sortable="false" style="font-weight:bold;text-align:center"/>
    </c:if>
    <display:column property="${checkvalue}" title="Instance Type" sortable="false"/>
    <display:column property="${checkvalSum}" title="Instance Type" sortable="false" style="font-weight:bold;text-align:center"/>
    <display:column property="firstWeekOfCount" title="${manualASNFirstWeekOfCount}" sortable="false" autolink="true"/>
    <display:column property="secondWeekOfCount" title="${manualASNSecondWeekOfCount}" sortable="false"  autolink="true"/>
    <display:column property="thirdWeekOfCount" title="${manualASNThirdWeekOfCount}" sortable="false"  autolink="true"/>
    <display:column property="fourthWeekOfCount" title="${manualASNFourthWeekOfCount}" sortable="false" autolink="true" />
    <display:column property="fifthWeekOfCount" title="${manualASNFifthWeekOfCount}" sortable="false" autolink="true"/>
    <display:column property="sixthWeekOfCount" title="${manualASNSixthWeekOfCount}" sortable="false" autolink="true"/>
    </display:table>

推荐答案

<display:table name="${weeklyDlvyInstancesDashboardReportForm.manualASNListQO}" uid="manualASNListUID" sort="list" defaultsort="1" requestURI="/weeklyDlvyInstancesDashboardReportPre.do?method=httpGet" excludedParams="method" decorator="com.ford.mpl.superg.decorator.WeeklyDeliveryInstancesTypeTableDecorator" keepStatus="true">
    <%@include file="/jsp/include/displaytag.jsp"%>
    <c:set value="${manualASNListUID.firstWeekOfCountLabel}" var="manualASNFirstWeekOfCount"/>
    <c:set value="${manualASNListUID.secondWeekOfCountLabel}" var="manualASNSecondWeekOfCount"/>
    <c:set value="${manualASNListUID.thirdWeekOfCountLabel}" var="manualASNThirdWeekOfCount"/>
    <c:set value="${manualASNListUID.fourthWeekOfCountLabel}" var="manualASNFourthWeekOfCount"/>
    <c:set value="${manualASNListUID.fifthWeekOfCountLabel}" var="manualASNFifthWeekOfCount"/>
    <c:set value="${manualASNListUID.sixthWeekOfCountLabel}" var="manualASNSixthWeekOfCount"/>

    <c:choose>
    <c:when test="${asnAccuracyListUID.instanceTypeDescription != null && asnAccuracyListUID.instanceTypeDescription != 'Sum'}">
        <display:column property="instanceTypeDescription" title="Instance Type" sortable="false"/>
    </c:when>
    <c:otherwise>
        <display:column property="instanceTypeDescription" title="Instance Type" sortable="false" style="font-weight:bold;text-align:center"/>
    </c:otherwise>
    </c:choose>

    <display:column property="${checkvalue}" title="Instance Type" sortable="false"/>
    <display:column property="${checkvalSum}" title="Instance Type" sortable="false" style="font-weight:bold;text-align:center"/>
    <display:column property="firstWeekOfCount" title="${manualASNFirstWeekOfCount}" sortable="false" autolink="true"/>
    <display:column property="secondWeekOfCount" title="${manualASNSecondWeekOfCount}" sortable="false"  autolink="true"/>
    <display:column property="thirdWeekOfCount" title="${manualASNThirdWeekOfCount}" sortable="false"  autolink="true"/>
    <display:column property="fourthWeekOfCount" title="${manualASNFourthWeekOfCount}" sortable="false" autolink="true" />
    <display:column property="fifthWeekOfCount" title="${manualASNFifthWeekOfCount}" sortable="false" autolink="true"/>
    <display:column property="sixthWeekOfCount" title="${manualASNSixthWeekOfCount}" sortable="false" autolink="true"/>
    </display:table>

这篇关于如何使用display:table将记录设置为最后一条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 12:18