如何使用Display标记库在JSP中显示每个表格单元格的一个项目?

时间:2017-05-22 21:11:57

标签: html jsp displaytag

我正在使用Display Tag Library来执行分页和数据排序。我知道如何从列表中的常规表中显示每个表格单元格的一个项目,但使用显示标记库我有点卡住了。它在一个表格单元格中显示所有内容在场景显示标签后面生成tr和td标签,但我很困惑如何在每个表格单元格中显示以下esignNumDocs

希望问题很明确。

<display:column title="# of E-Sign Documents" class="displayColumns" >
            <c:forEach items="${intgList}" var="list">
                <c:if test="${list.policyNbrLink eq false}">
                    <td class="dataFieldCell1" align="center"><c:out value="${list.policyNumber}"/></td>
                </c:if>
                <a id="eSignNumDocs" href= "javascript:locateFunc('viewESignDetails', {'url':'<integration:urlAction actionName="/integration/viewDetailsIntegration"><integration:urlParam key="esignIdentifier" value="${list.esignId}"/></integration:urlAction>',
                    'agencyCode':'${list.agencyCode}',
                    'policyNumber':'${list.policyNumber}',
                    'policyState':'${list.policyState}',
                    'esignIdentifier':'${list.esignId}',
                    'esignVendorIdentifier':'${list.esignVendorIdentifier}',
                    'lob':'${list.lob}',
                    'transId':'${list.transId}',
                    'customerName':'${list.insuredName}',
                    'customerPhone':'${list.custPhone}',
                    'customerEmail':'${list.custEmail}',
                    'cretedDate':'${list.createdDate}'});">
                    <c:out value="${list.esignNumDocs}"/>
                </a>    
            </c:forEach>
        </display:column>

我需要在每个表格单元格中显示eSignNumDocs一个值,但使用上面的代码,它会在单元格中显示1,2。如何在一行中显示1,在下一行中显示2?

感谢。

1 个答案:

答案 0 :(得分:0)

好吧,伙计们,我认为这可能对某人有所帮助。显示标记也接受隐式对象。因为它无论如何需要列表我不需要再次遍历# of ESign docs列。相反,我在我的案例中使用了表{id} data,并传递了它来初始化URL中的所有变量。以下显示了包含更改的完整代码。

<display:table id="data" name="intgList" requestURI="/integration/viewIntegration" class="fieldLabelCell" pagesize="10">
        <!-- Setting table properties -->
        <display:setProperty name="paging.banner.page.selected" value="{0}" />
        <display:setProperty name="basic.empty.showtable" value="true"/>
        <display:setProperty name="paging.banner.placement" value="top"/>
        <display:setProperty name="basic.msg.empty_list_row" value=""/>
        <display:setProperty name="paging.banner.group_size" value="2"/>
        <display:setProperty name="paging.banner.no_items_found" value=""/>
        <display:setProperty name="paging.banner.page.separator" value=" of "/>
        <display:setProperty name="paging.banner.first" value='<span class="pagelinks"> |< << | Page {0} <a href="{3}"> | >> </a><a href="{4}">>|</a></span>'/>
        <display:setProperty name="paging.banner.last" value='<span class="pagelinks"> <a href="{1}">|< </a> <a href="{2}"> << | Page </a> {0} | >> >| </span>'/>
        <display:setProperty name="paging.banner.full" value='<span class="pagelinks"> <a href="{1}">|< </a> <a href="{2}"> << | Page </a> {0}<a href="{3}"> | >> </a><a href="{4}">>| </a></span>'/>

        <!-- Displaying columns data -->
        <display:column property="lob" title="Line of<br>Business" sortable="true" class="displayColumns" />
        <display:column property="insuredName" title="Insured" sortable="true"  class="displayColumns"/>
        <display:column property="custPhone" title="Customer<br>Phone" sortable="true"  class="displayColumns" />
        <display:column property="policyNumber" title="Policy #" sortable="true" class="displayColumns" />
        <display:column property="createdDate" title="E-Sign<br>Created Date" sortable="true" class="displayColumns" />
        <display:column property="custEmail" title="Customer<br>Email" sortable="true" class="displayColumns" />
        <display:column title="# of E-Sign Documents" class="displayColumns" >
            <c:if test="${list.policyNbrLink eq false}">
                <td class="dataFieldCell1" align="center"><c:out value="${list.policyNumber}"/></td>
            </c:if> 
            <a id="eSignNumDocs" href= "javascript:locateFunc('viewESignDetails', {'url':'<integration:urlAction actionName="/integration/viewDetailsIntegration"><integration:urlParam key="esignIdentifier" value="${data.esignId}"/></integration:urlAction>',
                'agencyCode':'${data.agencyCode}',
                'policyNumber':'${data.policyNumber}',
                'policyState':'${data.policyState}',
                'esignIdentifier':'${data.esignId}',
                'esignVendorIdentifier':'${data.esignVendorIdentifier}',
                'lob':'${data.lob}',
                'transId':'${data.transId}',
                'customerName':'${data.insuredName}',
                'customerPhone':'${data.custPhone}',
                'customerEmail':'${data.custEmail}',
                'cretedDate':'${data.createdDate}'});">
                <c:out value="${data.esignNumDocs}"/>
            </a>
        </display:column>
    </display:table>