0

以下のコードでは、sortable=true を使用して表示タグの残高列を並べ替える必要がありますが、この値を Bean で定義して書式設定し、通貨記号を配置すると機能しません (セッション オブジェクトから通貨記号を取得します)。

<% String strCurrency=(String)session.getAttribute("strCurrency"); %>

    <display:table id="data1" name="invprbmList" requestURI=""  pagesize="10" export="true" style="width:100%;">
    <tr>
     <td><display:setProperty name="paging.banner.item_name">Invoice</display:setProperty>
     <display:setProperty name="paging.banner.items_name">Invoices</display:setProperty>
     <display:setProperty name="paging.banner.some_items_found"><span class="pagebanner"> {0} Invoices found, displaying {2} to {3}. </span></display:setProperty>              
     <bean:define id="invoiceNo"><bean:write name="data1" property="invoiceNo"/></bean:define>
     <bean:define id="invAmt"><bean:write name="data1" property="invAmount" format="#,##,##0.00"/></bean:define>
     <bean:define id="balance"><bean:write name="data1" property="balance" format="#,##,##0.00"/></bean:define>

     <display:column  title="Invoice No." sortable="true" media="html" class="l" headerClass="hl"><a href="GetInvoiceShippingDetails.do?invoiceNo=<%=invoiceNo%>&custno=<%=custno%>"><%=invoiceNo%></a></display:column>
     <display:column  property="invDate" title="Invoice Date" format="{0,date,dd-MMM-yyyy}" sortable="true" class="l" headerClass="hl"/>
     <display:column  media="html" title="Amount" sortable="true" class="r" headerClass="hr"><%=strCurrency%><%=invAmt %></display:column>
     <display:column  property="dueDate"    title="Due Date" format="{0,date,dd-MMM-yyyy}" sortable="true" class="l" headerClass="hl"/>
     <display:column  media="html" title="Balance" sortable="true" class="r" headerClass="hr"><%=strCurrency%><%=balance %></display:column>
     <display:column  title="Balance" sortable="true" property="balance" media="xml csv pdf excel" class="r" headerClass="hr" />
     <display:column  property="followUpDate" title="Follow-up Date" format="{0,date,dd-MMM-yyyy}" sortable="true" class="l" headerClass="hl"/>
     </td>
    </tr>
    </display:table>
4

1 に答える 1

0

Beanでbalance(getメソッド内)をフォーマットするための別のプロパティを作成できます。つまり、setとgetを使用してbalanceHtmlを作成し、として表示し<display:column property="balanceHtml" sortable="true"/>ます。

于 2013-02-03T22:47:33.220 に答える