invoice2-setup.jsp

<%@ page contentType="text/html; charset=euc-jp" %>
<!-- 
  Copyright 2001, Pajato Systems Group
  Copyright 2001, Allaire Corporation
-->

<h1>シンプルな請求書ジェネレータ</h1>

<p>

このサンプルは、スクリプトレットおよび JRun カスタム タグ 
ライブラリを使用する表現と、データ モデルを操作する Java Bean 
の使用を最小限に抑えた請求書ジェネレータです。
請求書発効日は、Emacs 時間管理システムにより生成されます。

<p>

<!-- Provide the page context to the invoice bean.  This  -->
<!-- enables the bean (and the data model) to obtain data -->
<!-- as application resources.                            -->

<%  invoiceBean.setPageContext( pageContext ); %>

<!-- Use the client company property to establish the     -->
<!-- data model access method based on the User's         -->
<!-- selections of client company and week ending date.   -->

<jsp:setProperty name="invoiceBean" property="clientCompany" />
<jsp:setProperty name="invoiceBean" property="weekEnding" />

<table align="left">
  <tr>
    <th align="right">発注元会社の選択:</th>
    <td align="left">
      <select name="clientCompany"
              onClick="this.form.submit()">

        <!-- Loop through each company to generate a choice entry. -->
        <jrun:foreach
          item="company"
          type="String"
          group="<%= invoiceBean.getCompanies() %>">
          <option
	    <jsp:setProperty name="invoiceBean" property="item" value="<%= company %>" />
            <jsp:getProperty name="invoiceBean" property="selected" />
            value="<%= company %>"> <%= company %>
        </option>
        </jrun:foreach>

      </select>
    </td>
  </tr>

  <!-- Do not present a week ending date selector if a  -->
  <!-- client company has not been selected yet.        -->
  <% if ( invoiceBean.getClientCompany() != null ) { %>
    <tr>
      <th align="right">週の選択 (週の終わりの日付):</th>
      <td align="left">
        <select name="weekEnding">

          <!-- Loop through each week to generate a choice entry. -->
          <jrun:foreach
            item="week"
            type="String"
            group="<%= invoiceBean.getWeeks() %>">
            <option
	      <jsp:setProperty name="invoiceBean" property="item" value="<%= week %>" />
              <jsp:getProperty name="invoiceBean" property="selected" />
              value="<%= week %>"> <%= week %>
          </option>
          </jrun:foreach>
        </select>
      </td>
    </tr>
    <tr><th></th><td><hr></td></tr>
    <tr>
      <th></th>
      <td>
        <input
          type="submit" name="generateInvoice" value="請求書の生成"
          onClick="invoiceForm.operation.value='GENERATE';this.form.submit()">
      </td>
    </tr>
  <% } %>
</table>