<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<h1><bean:message key="prompt.jobEditForm.title"/></h1>
<logic:messagesPresent>
	<ul>
	<bean:message key="errors.header"/>
	<html:messages id="error">
		<li><bean:write name="error"/></li>
	</html:messages>
	</ul>
	<hr>
</logic:messagesPresent>

<html:form action="/scheduler/jobEditAction" focus="groupName" onsubmit="return validateJobEditForm(this);">

<div id="EDITTAG" align="left">

    <table width="100%">
    	<tr>
			<td  width="25%" class="title"><bean:message key="prompt.jobEditForm.groupName"/></strong><img src="images/4_dot.gif"/></td>
			<td>
				<logic:empty name="jobEditForm" property="name">
					<html:text styleClass="inputtext" name="jobEditForm" property="groupName"  size="32" maxlength="32"/>
				</logic:empty>
				<logic:notEmpty name="jobEditForm" property="name">
					<html:text styleClass="inputtext" name="jobEditForm" property="groupName" readonly="true" size="32" maxlength="32"/>
				</logic:notEmpty>
				<bean:message key="prompt.jobEditForm.groupNameUniq"/>
			</td>
		</tr>
    	<tr>
			<td class="title"><bean:message key="prompt.jobEditForm.jobName"/></strong><img src="images/4_dot.gif"/></td>
			<td>
				<logic:empty name="jobEditForm" property="name">
					<html:text styleClass="inputtext" name="jobEditForm" property="name"  size="32" maxlength="32"/>
				</logic:empty>
				<logic:notEmpty name="jobEditForm" property="name">
					<html:text styleClass="inputtext" name="jobEditForm" property="name" readonly="true" size="32" maxlength="32"/>
				</logic:notEmpty>
				<bean:message key="prompt.jobEditForm.groupNameUniq"/>
			</td>
		</tr>
		<tr>
			<td class="title"><bean:message key="prompt.jobEditForm.className"/></strong><img src="images/4_dot.gif"/></td>
			<td>
				<html:text styleClass="inputtext" name="jobEditForm" property="jobClass"  size="60"/>
			</td>
		</tr>
		<tr>
			<td class="title"><bean:message key="prompt.jobEditForm.jobDescription"/></strong><img src="images/4_dot.gif"/></td>
			<td>
				<html:textarea styleClass="inputtext" name="jobEditForm" property="description" rows="5" cols="60"/>
			</td>
		</tr>
		<tr>
			<td class="title"><bean:message key="prompt.jobEditForm.recovery"/></strong><img src="images/4_dot.gif"/></td>
			<td>
				<html:checkbox styleClass="inputtext" name="jobEditForm" property="volatility"/>
			</td>
		</tr>
		<tr>
			<td class="title"><bean:message key="prompt.jobEditForm.durableFlg"/></strong><img src="images/4_dot.gif"/></td>
			<td>
				<html:checkbox styleClass="inputtext" name="jobEditForm" property="durable"/>
				<bean:message key="prompt.jobEditForm.durable"/>
			</td>
		</tr>
	</table>
</div>

<div id="DISPLAYTAG">
    <h2><bean:message key="prompt.jobEditForm.parameter"/></h2>
	<table width="100%">
	  <thead>
		<tr>
			<th width="25%"><bean:message key="prompt.jobEditForm.parameterName"/></th>
			<th width="50%"><bean:message key="prompt.jobEditForm.parameterValue"/></th>
			<th align="center">&nbsp;</th>
		</tr>
	  </thead>
	  <tbody>
	  	<html:hidden name="jobEditForm" property="parameterCount"/>
		<logic:present name="jobEditForm" property="jobParameters">
			<logic:iterate id="parameter" name="jobEditForm" property="jobParameters">
			    <tr class="even">
					<td align="center">
						<html:text name="parameter" property="parameterName" size="20" maxlength="32" indexed="true"/>
					</td>
					<td>
						<html:text name="parameter" property="parameterValue" size="60" indexed="true"/>
					</td>
					<td align="left">
						<logic:equal name="parameter" property="required" value="true">
							<bean:message key="prompt.jobEditForm.required"/>
						</logic:equal>
						&nbsp;
					</td>
			    </tr>
			</logic:iterate>
		</logic:present>
	  </tbody>
	</table>

</div>
<div id="COMMANDTAG">
    <table width="100%">
      <tr>
        <td height="50" width="5%">
			&nbsp;
        </td>
        <td align="center" width="20%">
　　      <html:submit styleClass="button" property="submit" onclick="bCancel=false;">&nbsp;&nbsp;&nbsp;&nbsp;<bean:message key="prompt.scheduler.ok"/>&nbsp;&nbsp;&nbsp;&nbsp;</html:submit>
        </td>
        <td align="center" width="20%">
　　      <html:cancel styleClass="button" onclick="bCancel=true;"><bean:message key="prompt.scheduler.cancel"/></html:cancel>
		</td>
        <td align="center" width="20%">
　　　    <html:reset styleClass="button">&nbsp;&nbsp;<bean:message key="prompt.scheduler.reset"/>&nbsp;&nbsp;</html:reset>
        </td>
        <td height="50">
			&nbsp;
        </td>
      </tr>
    </table>
</div>
</html:form>

<html:javascript formName="jobEditForm"/>
