preferenceform.jsp

来自「Java的框架」· JSP 代码 · 共 129 行

JSP
129
字号
<%@ include file="/common/taglibs.jsp"%>

<spring:bind path="preference.*">
    <c:if test="${not empty status.errorMessages}">
    <div class="error">	
        <c:forEach var="error" items="${status.errorMessages}">
            <img src="<c:url value="/images/iconWarning.gif"/>"
                alt="<fmt:message key="icon.warning"/>" class="icon" />
            <c:out value="${error}" escapeXml="false"/><br />
        </c:forEach>
    </div>
    </c:if>
</spring:bind>

<form method="post" action="<c:url value="/editPreference.action"/>" id="preferenceForm" onsubmit="return onFormSubmit(this)">
    
<spring:bind path="preference.version">
	<input type="hidden" name="version" value="<c:out value="${status.value}"/>"/> 
</spring:bind>

<spring:bind path="preference.id">
	<input type="hidden" name="id" value="<c:out value="${status.value}"/>"/> 
</spring:bind>

<input type="hidden" name="from" value="<c:out value="${param.from}"/>" />
<input type="hidden" name="method" value="<c:out value="${param.method}"/>" />

<table class="detail">
<c:set var="pageButtons">
	<tr>
  	<td></td>
 		<td class="buttonBar">
    
 		<c:if test="${param.from != 'list'}">
      <input type="submit" class="button" name="save" onclick="bCancel=false" value="<fmt:message key="button.save"/>" />
  	</c:if>
    
  	<c:if test="${param.from == 'list'}">
    	
  		<c:if test="${param.method == 'Add'}">
      <input type="submit" class="button" name="save" onclick="bCancel=false" value="<fmt:message key="button.add"/>" />		
      </c:if>
   		
      <c:if test="${param.method != 'Add'}">
      <input type="submit" class="button" name="save" onclick="bCancel=false" value="<fmt:message key="button.save"/>" />
      <input type="submit" class="button" name="delete" onclick="bCancel=true;return confirmDelete('preference')" value="<fmt:message key="button.delete"/>" />
      </c:if>       
 		</c:if>
        
   		<input type="submit" class="button" name="cancel" onclick="bCancel=true" value="<fmt:message key="button.cancel"/>" />
   	</td>
	</tr>
</c:set>

	<tr>
  	<th>
    	<mcaps:label key="preference.key"/>
   	</th>
 		<td>
    	<spring:bind path="preference.key">
    		<input type="text" name="key" value="<c:out value="${status.value}"/>" id="key" maxlength="200"/>
        <span class="fieldError"><c:out value="${status.errorMessage}" escapeXml="false" /></span>
      </spring:bind>
   	</td>
	</tr>
  
	
	<tr>
  	<th>
    	<mcaps:label key="preference.value"/>
   	</th>
    <td>
    	<spring:bind path="preference.value">
      	<input type="text" name="value" value="<c:out value="${status.value}"/>" id="value" maxlength="255"/>
        <span class="fieldError"><c:out value="${status.errorMessage}"/></span>
     	</spring:bind>
   	</td>
	</tr>
 	
	
	
	<tr>
  	<th>
    	<label for="enabled"><fmt:message key="preference.readOnly"/>?</label>
   	</th>
    <td>
    	<spring:bind path="preference.readOnly">
     		<input type="hidden" name="_<c:out value="${status.expression}"/>"  value="visible" /> 
        <input type="checkbox" name="<c:out value="${status.expression}"/>" value="true" <c:if test="${status.value}">checked="checked"</c:if> /> 
    	</spring:bind>
  	</td>
	</tr>
 	  
<%-- Print out buttons - defined at top of form --%>
    <%-- This is so you can put them at the top and the bottom if you like --%>
	<c:out value="${pageButtons}" escapeXml="false" />

</table>
</form>
    



<script type="text/javascript">
<!--
highlightFormElements();

<%-- if we're doing an add, change the focus --%>

	<c:set var="focus" value="key"/>
	

var focusControl = document.forms["preferenceForm"].elements["<c:out value="${focus}"/>"];

if (focusControl.type != "hidden" && !focusControl.disabled) {
    focusControl.focus();
}


<!-- This is here so we can exclude the selectAll call when roles is hidden -->
function onFormSubmit(theForm) {
    return validatePreference(theForm);
}
// -->
</script>

<v:javascript formName="preference" staticJavascript="false"/>
<script type="text/javascript"
      src="<c:url value="/scripts/validator.jsp"/>"></script>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?