如何将Struts 2中的迭代器列表传递给JavaScript? 扣除 组成部分 分配
如果迭代器列表中的如何将Struts 2中的迭代器列表传递给JavaScript? 扣除 组成部分 分配,javascript,jsp,struts2,ognl,struts-tags,Javascript,Jsp,Struts2,Ognl,Struts Tags,如果迭代器列表中的allowanceList.allocatedSalAmount的值都不大于0,我需要隐藏整个字段集 我想调用JavaScript并传递resultLists.declarationlists的值,然后如果有allowanceList.allocatedSalAmount则设置一个大于0的计数器 但是如何将resultlist.declarationlist的列表值传递给JavaScript并从中访问所有allowanceList.allocatedSalAmount?要隐藏整
allowanceList.allocatedSalAmount
的值都不大于0,我需要隐藏整个字段集
我想调用JavaScript并传递resultLists.declarationlists
的值,然后如果有allowanceList.allocatedSalAmount
则设置一个大于0的计数器
但是如何将
resultlist.declarationlist的列表值传递给JavaScript并从中访问所有allowanceList.allocatedSalAmount
?要隐藏整个字段集,必须使用s:if
标记将其包装起来
<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>
扣除
组成部分
分配
因为在fieldset中一次只能迭代一个列表,所以不能让同一个迭代器迭代两个列表。您必须在s:if
标记中定义要计算的正确表达式,以决定是否应显示字段集 要隐藏整个字段集
必须使用s:if
标记将其包装起来
<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>
扣除
组成部分
分配
因为在fieldset中一次只能迭代一个列表,所以不能让同一个迭代器迭代两个列表。您必须在s:if
标记中定义要计算的正确表达式,以决定是否应显示字段集 什么是allowanceList?它在哪里?您是否有一个列表列表,以及另一个名为allowanceList的平行列表?或者它是一个列表的列表?你的结构不清楚,我知道如何解决你的问题,但要写一个更具体的答案,我宁愿有结构allowanceList是什么?它在哪里?您是否有一个列表列表,以及另一个名为allowanceList的平行列表?或者它是一个列表的列表?你的结构不清楚,我知道如何解决你的问题,但要写一个更具体的答案,我宁愿有结构