1

我在 Application.cfm 中有这些代码:

<CFSET Application.Payroll.Garnishment.PmtCodes = structNew()>
<CFSET Application.Payroll.Garnishment.PmtCodes[1] = "0 - Canceled check">
<CFSET Application.Payroll.Garnishment.PmtCodes[2] = "1 - Closed paymentadjustment">
<CFSET Application.Payroll.Garnishment.PmtCodes[3] = "2 - Multiple payments on one check">
<CFSET Application.Payroll.Garnishment.PmtCodes[4] = "3 - ACH/CTP Payments">
<CFSET Application.Payroll.Garnishment.PmtCodes[5] = "5 - Check Pick-up">
<CFSET Application.Payroll.Garnishment.PmtCodes[6] = "5A - Special Handling">
<CFSET Application.Payroll.Garnishment.PmtCodes[7] = "7 - One invoice paid on one check">
<CFSET Application.Payroll.Garnishment.PmtCodes[8] = "8 - Payroll - Garnishment (Payroll use only)">
<CFSET Application.Payroll.Garnishment.PmtCodes[9] = "9 - Manual check/wire transfer/bankdraft">
<CFSET Application.Payroll.Garnishment.PmtCodes[10] = "C - ACH Transfers (ap use only)">
<CFSET Application.Payroll.Garnishment.PmtCodes[11] = "D - Foreign bank drafts">
<CFSET Application.Payroll.Garnishment.PmtCodes[12] = "H - Hospital Managed Care">
<CFSET Application.Payroll.Garnishment.PmtCodes[13] = "M - Cash advances (AP use only)">
<CFSET Application.Payroll.Garnishment.PmtCodes[14] = "T - Wire US/ Foreign $ to Foreign bank (ap)">
<CFSET Application.Payroll.Garnishment.PmtCodes[15] = "V - Multiple Vendor Payments on credit card">
<CFSET Application.Payroll.Garnishment.PmtCodes[16] = "W - Wire US/Foreign $ US/Foreign bank (ap)">
<CFSET Application.Payroll.Garnishment.PmtCodes[16] = "Y - Payroll rush Checks (ap use only)">
<CFSET Application.Payroll.Garnishment.PmtCodes[16] = "Z - Student Aid check from Banner">

我正在尝试利用该结构在 update-employee.cfm 上创建一个下拉列表,如下所示:

<SELECT NAME="PmtCodes" SIZE="1">    
    <CFOUTPUT>      
    <CFLOOP collection="#Application.Payroll.Garnishment.PmtCodes#" item="key">
       <OPTION VALUE="#Application.Payroll.Garnishment.PmtCodes[key]#">  </OPTION>       
    </CFLOOP>
    </CFOUTPUT>
</SELECT>

但是,下拉列表中没有填充数据。有什么建议么?谢谢。

4

2 回答 2

2

你需要在<option>标签中显示一些东西

如果要显示值并返回值

<OPTION VALUE="#Application.Payroll.Garnishment.PmtCodes[key]#">#xmlformat(Application.Payroll.Garnishment.PmtCodes[key])#</OPTION>

如果你想归还密钥

<OPTION VALUE="#key#">#xmlformat(Application.Payroll.Garnishment.PmtCodes[key])#</OPTION>

包括xmlformat()这样,如果你的结构有特殊字符,它不会破坏表格

于 2013-11-22T18:43:47.737 回答
0

我认为您也需要在 OPTION 标签中包含一些内容。所以我会把那部分写成

<OPTION VALUE="#Application.Payroll.Garnishment.PmtCodes[key]#"> #Application.Payroll.Garnishment.PmtCodes[key]#  </OPTION> 
于 2013-11-22T18:43:05.160 回答