ColdFusion - 使用查询输出存储每行的变量以重新查询编辑

时间:2016-02-24 23:27:42

标签: sql forms coldfusion cfml

我绝对是CFML的小伙子,并且一直试图将这个问题包围起来。我的查询输出我的数据与我创建的详细信息按钮,将进入一个新页面来编辑信息。每个#INV#都会有更多与之关联的订单项供审核。我的目标是单击按钮并根据该给定行的INV运行查询,以返回需要在新页面中进行某种批准的所有关联行项目的输出。然后让我能够编辑数据。

我认为我需要能够将INV列作为变量存储在我的代码中,但我不知道如何实现这一点。

抱歉,如果不太清楚的话!

<cfquery name="Review" datasource="FINANCE_EQMT_ACCT"> 
    SELECT '1' as ROW, ''ABC CO.' AS OWNER, 'T1234567' AS INV, '50.00' AS TOTAL FROM TBL_TEST

</cfquery> 
<div class="container col-xs-12 col-sm-12 col-md-5 col-md-push-1 col-lg-5 col-lg-push-1">   
  <div class="row">
    <table class="table table-striped">
      <legend>QUEUE</legend>
      <thead>
        <tr>
          <th class="text-center">#</th>
          <th>Owner</th>
                <th>Invoice</th>
          <th>Amount</th>
          <th></th>
            </tr>
      </thead>        
        <tbody>
         <cfoutput query="Review"> 
            <tr>
              <td class="text-center">#ROW#</td>
              <td>#OWNER#</td>
                    <td>#INV#</td>
              <td>#TOTAL#</td>
              <td class="text-right"><form action="review_action.cfm" method="post"><input class="btn btn-primary" type="submit" value="Detail"></form></td>
                </tr>
        </cfoutput>
        </tbody>
    </table>
  </div>
</div>

1 个答案:

答案 0 :(得分:4)

您无需保存。你只需要将它推到下一页

...
<td class="text-right">
  <form action="review_action.cfm" method="post">
     <input type="hidden" name="INV" value="#INV#" />
     <input class="btn btn-primary" type="submit" value="Detail">
  </form>
</td>
...
然后,

review_action.cfm会将该值作为form.inv

的一部分进行处理