alertform.jsp
来自「Java的框架」· JSP 代码 · 共 176 行
JSP
176 行
<%@ include file="/common/taglibs.jsp"%>
<head>
<title><fmt:message key="alertProfile.title"/></title>
<content tag="heading"><fmt:message key="alertProfile.heading"/></content>
<script type="text/javascript" src="<c:url value='/scripts/selectbox.js'/>"></script>
</head>
<!-- You could also add a message to the default decorator and not use this page. -->
<fmt:message key="alertProfile.add.message"/>
<div class="separator"></div>
<spring:bind path="alert.*">
<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="/addAlert.action"/>" id="alertForm" 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.add"/>" />
<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="alert.subject"/>
</th>
<td>
<spring:bind path="alert.subject">
<input type="text" name="subject" id="subject" value="<c:out value="${status.value}"/>" maxlength="255"/>
<span class="fieldError"><c:out value="${status.errorMessage}"/></span>
</spring:bind>
</td>
</tr>
<tr>
<th>
<mcaps:label key="alert.text"/>
</th>
<td>
<spring:bind path="alert.text">
<textarea name="text" id="text" rows="5" cols="50"><c:out value="${status.value}"/></textarea>
<span class="fieldError"><c:out value="${status.errorMessage}"/></span>
</spring:bind>
</td>
</tr>
<tr>
<th>
<mcaps:label key="alert.type"/>
</th>
<td>
<spring:bind path="alert.type">
<select name="type" id="type">
<option value="Alert" <c:if test="${status.value == 'Alert'}">selected</c:if>>Alert</option>
<option value="Notification" <c:if test="${status.value == 'Notification'}">selected</c:if>>Notification</option>
</select>
<span class="fieldError"><c:out value="${status.errorMessage}"/></span>
</spring:bind>
</td>
</tr>
<tr>
<td></td>
<td>
<fieldset class="pickList">
<legend>
<fmt:message key="alertProfile.assignUsers"/>
</legend>
<table class="pickList">
<tr>
<th class="pickLabel">
<mcaps:label key="alert.availableUsers" colon="false" styleClass="required"/>
</th>
<td>
</td>
<th class="pickLabel">
<mcaps:label key="alert.users" colon="false" styleClass="required"/>
</th>
</tr>
<mcaps:userList key="leftList" scope="request" />
<c:import url="/WEB-INF/pages/pickList.jsp">
<c:param name="listCount" value="1"/>
<c:param name="leftId" value="availableUsers"/>
<c:param name="rightId" value="alertUsers"/>
</c:import>
</table>
</fieldset>
</td>
</tr>
<tr>
<td></td>
<td>
<fieldset class="pickList">
<legend>
<fmt:message key="alertProfile.assignRoles"/>
</legend>
<table class="pickList">
<tr>
<th class="pickLabel">
<mcaps:label key="alert.availableRoles" colon="false" styleClass="required"/>
</th>
<td>
</td>
<th class="pickLabel">
<mcaps:label key="alert.roles" colon="false" styleClass="required"/>
</th>
</tr>
<mcaps:roleList key="leftList" scope="request" />
<c:import url="/WEB-INF/pages/pickList.jsp">
<c:param name="listCount" value="1"/>
<c:param name="leftId" value="availableRoles"/>
<c:param name="rightId" value="alertRoles"/>
</c:import>
</table>
</fieldset>
</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="subject"/>
var focusControl = document.forms["alertForm"].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) {
selectAll('alertRoles');
selectAll('alertUsers');
return validateAlert(theForm);
}
// -->
</script>
<v:javascript formName="alert" staticJavascript="false"/>
<script type="text/javascript" src="<c:url value="/scripts/validator.jsp"/>"></script>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?