userpreference.jsp

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

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


<head>
    <title><fmt:message key="userPreference.title"/></title>
    <content tag="heading"><fmt:message key="userPreference.heading"/></content>
</head>

<!-- You could also add a message to the default decorator and not use this page. -->
	<fmt:message key="userPreference.message"/>
  
	<div class="separator"></div>


	<spring:bind path="userPreferenceCommand.*">
    <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="/editUserPreference.action"/>" id="userPreferenceForm" onsubmit="return onFormSubmit(this)">
    
	<table class="detail">
		<c:set var="pageButtons">
		<tr>
  		<td></td>
 			<td class="buttonBar">
    		<input type="submit" class="button" name="save" onclick="bCancel=false" value="<fmt:message key="button.save"/>" />
      	<input type="submit" class="button" name="reset" onclick="bCancel=true;return confirmReset()" value="<fmt:message key="button.reset"/>" />
    		<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="userPreference.pageSize"/>
	   	</th>
	 		<td>
	    	<spring:bind path="userPreferenceCommand.pageSize">
	    		<input type="text" name="pageSize" value="<c:out value="${status.value}"/>" id="pageSize"/>
	        <span class="fieldError"><c:out value="${status.errorMessage}" escapeXml="true" /></span>
	      </spring:bind>
	   	</td>
	</tr>
	
	<tr>
	  	<th>
	    	<mcaps:label key="userPreference.locale"/>
	   	</th>
	 		<td>
	    	<spring:bind path="userPreferenceCommand.locale">
	    		<select name="locale">
	    			<option value="en" <c:if test="${status.value == 'en'}">selected</c:if>>English</option>
	    			<option value="zh" <c:if test="${status.value == 'zh'}">selected</c:if>>Chinese</option>
	    			<option value="sv" <c:if test="${status.value == 'sv'}">selected</c:if>>Swedish</option>
	    		</select>
	    	</spring:bind>
	   	</td>
	</tr>
  
	<tr>
	  	<th>
	    	<mcaps:label key="userPreference.theme"/>
	   	</th>
	 		<td>
	    	<spring:bind path="userPreferenceCommand.theme">
	    		<select name="theme">
	    			<option value="default" <c:if test="${status.value == 'default'}">selected</c:if>>Default</option>
	    			<option value="blue" <c:if test="${status.value == 'blue'}">selected</c:if>>Blue</option>
	    			<option value="green" <c:if test="${status.value == 'green'}">selected</c:if>>Green</option>
	    			<option value="red" <c:if test="${status.value == 'red'}">selected</c:if>>Red</option>
	    			<option value="yellow" <c:if test="${status.value == 'yellow'}">selected</c:if>>Yellow</option>
	    			<option value="revival" <c:if test="${status.value == 'revival'}">selected</c:if>>Artistic</option>
	    		</select>
	    	</spring:bind>
	   	</td>
	</tr>
  
	<tr>
	  	<th>
	    	<mcaps:label key="userPreference.menu"/>
	   	</th>
	 		<td>
	    	<spring:bind path="userPreferenceCommand.menu">
	    		<select name="menu">
	    			<option value="list" <c:if test="${status.value == 'list'}">selected</c:if>>Expand Collapse Menu</option>
	    			<option value="cool" <c:if test="${status.value == 'cool'}">selected</c:if>>Drop Down Menu</option>
	    		</select>
	    	</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="pageSize"/>
	

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

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


function onFormSubmit(theForm) {
    return validateUserPreferenceCommand(theForm);
}


function confirmReset(obj) {   
    var msg = 
    ans = confirm("Are you sure you want to reset preference setting to default?");
    if (ans) {
        return true;
    } else {
        return false;
    }
}

// -->
</script>

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

⌨️ 快捷键说明

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