在下面的代码中,我必须使用 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>