Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将Struts 2中的迭代器列表传递给JavaScript? 扣除 组成部分 分配_Javascript_Jsp_Struts2_Ognl_Struts Tags - Fatal编程技术网

如何将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的平行列表?或者它是一个列表的列表?你的结构不清楚,我知道如何解决你的问题,但要写一个更具体的答案,我宁愿有结构