【发布时间】:2016-05-26 01:35:06
【问题描述】:
<fieldset class="fieldset">
<legend class="legendtitle">DEDUCTIONS</legend>
<table width="100%" border="0" cellspacing= "0" cellpadding="0">
<tr>
<td class="Htd_one1" width="20%"><div align="center">Component</div></td>
<td class="Htd_one1" width="20%"><div align="center">Allocated</div></td>
</tr>
<s:iterator value="%{#resultLists.deductionLists}" id="hrEmpSalaryCompDeductionList"
status="stat">
<s:if test="%{#allowanceList.allocatedSalAmount > 0}">
<tr>
<td class="labelone1" >
<div align="center">
<s:property value="%{#allowanceList.componentDesc}" />
</div>
</td>
<td class="dataone1" >
<div align="right">
<s:property value="%{#allowanceList.allocatedSalAmount}" />
</div>
</td>
</tr>
</s:if>
</s:iterator>
</table>
</fieldset>
如果迭代器列表resultLists.deductionLists中allowanceList.allocatedSalAmount的值都不大于0,我需要隐藏整个字段集。
我想调用 JavaScript 并传递 resultLists.deductionLists 的值,然后在 allowanceList.allocatedSalAmount 大于 0 时设置一个计数器。
但是如何将resultLists.deductionLists 的列表值传递给JavaScript 并从中访问所有allowanceList.allocatedSalAmount?
【问题讨论】:
-
什么是allowanceList?它在哪里 ?您是否有一个 List of Lists 和另一个名为 permitList 的并行 List ?或者它是一个 List of Lists 列表?你的结构不清楚,我知道如何解决你的问题,但要写一个更具体的答案,我宁愿有结构
标签: javascript jsp struts2 ognl struts-tags