<%@ page contentType="text/html;charset=Shift_JIS" language="java" %>
<%-- 共通ページヘッダ --%>
<%@ include file="/jsp/common/PageHeader.inc" %>
<%-- bean --%>
<jsp:useBean id="selectionControl" scope="session" type="SelectionControl" />
<jsp:useBean id="selection" scope="session" type="ISelection" />

<html:html locale="true">
<head>
<!-- 区分登録変更 -->
<title><bean:message key="selectionedit.title.displayname" /></title>
<html:base/>
<LINK rel="stylesheet" href="style.css">
</head>
<body>
<!--======================= メニュー ==============================-->
<%@ include file="/jsp/common/Menu9.inc" %>
<!--======================= メニュー end ==========================-->
<font color="red"><html:errors/></font>
<html:form action="/selectionEdit">
  <TABLE cellpadding="3" cellspacing="1">
    <TR> 
      <TD class="label3" colspan="2">
         <%= selectionControl.getTableNameJapanese() %>
         <!-- の設定内容 -->
         <bean:message key="selectionedit.category1.displayname" />
      </TD>
    </TR>
    <TR> 
<%    if (selectionControl.getAction().equals("add")) { 
%>
        <td class="label2"><font color="red">*</font><bean:message key="code.displayname" /></td>
        <td class="bak1"> 
          <html:text property="code" size="10" maxlength="2" />
        </td>
<%    } else {
%>
        <td class="label2"><bean:message key="code.displayname" /></td>
        <TD class="bak1">
           <%= selection.getCode() %>
        </TD>
<%    }
%>
    </TR>
    <TR> 
<%    if ((selectionControl.getAction().equals("add")) || 
          (selectionControl.getAction().equals("update"))) {
%>
        <TD class="label2"> 
          <font color="red">*</font><bean:message key="name.displayname" />
        </TD>
        <TD class="bak1"> 
          <html:text property="name" size="66" maxlength="64" />
        </TD>
<%    } else {
%>
        <td class="label2"><bean:message key="name.displayname" /></td>
        <TD class="bak1">
           <%= selection.getName() %>
        </TD>
<%    }
%>
    </TR>
    <TR> 
<%    if ((selectionControl.getAction().equals("add")) || 
          (selectionControl.getAction().equals("update"))) {
%>
          <TD class="label2">
            <font color="red">*</font><bean:message key="shortName.displayname" />
          </TD>
          <TD class="bak1"> 
            <html:text property="shortName" size="40" maxlength="40" />
          </TD>
<%    } else {
%>
          <td class="label2"><bean:message key="shortName.displayname" /></td>
          <TD class="bak1">
             <%= selection.getShortName() %>
          </TD>
<%    }
%>
    </TR>
    <tr> 
<%    if ((selectionControl.getAction().equals("add")) || 
          (selectionControl.getAction().equals("update"))) {
%>
        <td class="label2"><bean:message key="info.displayname" /></td>
        <td class="bak1"> 
          <html:textarea property="info" cols="64" rows="5" />
        </td>
<%    } else {
%>
        <td class="label2"><bean:message key="info.displayname" /></td>
        <TD class="bak1">
           <%= selection.getInfo() %>
        </TD>
<%    }
%>
    </tr>
    <tr> 
      <td colspan="2">
<%      String label = null;
        String action = selectionControl.getAction();
        if (action.equals("add")) {
            label = "追加";
        } else if (action.equals("update")) {
            label = "更新";
        } else if (action.equals("delete")) {
            label = "削除";
        }
%>
        <html:submit property="submit">
	        <logic:equal name="selectionControl" property="action" value="add" >
	        	<bean:message key="add.displayname" />
	        </logic:equal>
	        <logic:equal name="selectionControl" property="action" value="update" >
	        	<bean:message key="update.displayname" />
	        </logic:equal>
	        <logic:equal name="selectionControl" property="action" value="delete" >
	        	<bean:message key="delete.displayname" />
	        </logic:equal>
        </html:submit>
		<!-- リセット-->
	    <html:reset>
	    <bean:message key="reset.displayname" />
	    </html:reset>
		<!-- 一覧へ戻る-->
        <html:link forward="/selection" paramId="t" paramName="selectionControl" paramProperty="tableName">
	    <bean:message key="selectionedit.back.displayname" />
        </html:link><br>
      </td>
    </tr>
  </table>
</html:form>

<%-- 共通ページフッダ --%>
<%@ include file="/jsp/common/PageFooter.inc" %>
</body>
</html:html>
