⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userform.jsp

📁 采用jsp编写的企业计量设备管理系统
💻 JSP
字号:
<%@ include file="/common/taglibs.jsp"%>

<html:form action="saveUser" focus="password" styleId="userForm" 
    onsubmit="return validateUserForm(this)">
<html:hidden property="version"/>    
<input type="hidden" name="from" value="<c:out value="${param.from}"/>" />

<c:if test="${cookieLogin == 'true'}">
    <html:hidden property="password"/>
    <html:hidden property="confirmPassword"/>
</c:if>

<c:if test="${empty userForm.username}">
    <input type="hidden" name="encryptPass" value="true" />
</c:if>

<table class="detail">
<c:set var="pageButtons">
    <tr>
    	<td></td>
    	<td class="buttonBar">
            <html:submit styleClass="button" property="method" onclick="bCancel=false">
            	  <fmt:message key="button.save"/>
            </html:submit>
            
            <c:if test="${param.from == 'list'}">
            <html:submit styleClass="button" property="method"
                onclick="bCancel=false;return confirmDlg('确信要删除吗')" tabindex="14">
                <fmt:message key="button.delete"/>
            </html:submit>
            </c:if>
        
            <html:cancel styleClass="button" property="method" onclick="bCancel=true">
                <fmt:message key="button.cancel"/>
            </html:cancel>
        </td>
    </tr>
</c:set>
    <tr>
        <th>
            <pgmm:label key="userForm.username"/>
        </th>
        <td>
        <c:choose>
            <c:when test="${empty userForm.username}">
                <html:text property="username" styleId="username" />
                <html:errors property="username"/>
            </c:when>
            <c:otherwise>
                <c:out value="${userForm.username}"/>
                <html:hidden property="username" 
                    styleId="username"/>
            </c:otherwise>
        </c:choose>
        </td>
    </tr>
    <c:if test="${cookieLogin != 'true'}">
    <tr>
        <th>
            <pgmm:label key="userForm.password"/>
        </th>
        <td>
            <html:password property="password" size="40"
                onchange="passwordChanged(this)"
                styleId="password" redisplay="true"/>
            <html:errors property="password"/>
        </td>
    </tr>
    <tr>
        <th>
            <pgmm:label key="userForm.confirmPassword"/>
        </th>
        <td>
            <html:password property="confirmPassword" size="40"
                styleId="confirmPassword" redisplay="true"/>
            <html:errors property="confirmPassword"/>
        </td>
    </tr>
    </c:if>
    <tr>
        <th>
            <pgmm:label key="userForm.trueName"/>
        </th>
        <td>
            <html:text property="trueName" styleId="trueName" maxlength="50"/>
            <html:errors property="trueName"/>
        </td>
    </tr>
    <tr>
        <th>
            <pgmm:label key="userForm.department"/>
        </th>
        <td>
            <html:text property="department" styleId="department" maxlength="50"/>
            <html:errors property="department"/>
        </td>
    </tr>       
    <tr>
        <th>
            <pgmm:label key="userForm.phoneNumber"/>
        </th>
        <td>
            <html:text property="phoneNumber" styleId="phoneNumber"/>
            <html:errors property="phoneNumber"/>
        </td>
    </tr>
    <tr>
        <th>
            <pgmm:label key="userForm.email"/>
        </th>
        <td>
            <html:text property="email" styleId="email"/>
            <html:errors property="email"/>
        </td>
    </tr>
<c:choose>
    <c:when test="${param.from == 'list' or param.method == 'Add'}">
    <tr>
        <td></td>
        <td>
            <fieldset class="pickList">
                <legend>
                    <fmt:message key="userForm.availableRoles"/>
                </legend>
                <table class="pickList">
                    <tr>
                        <td>
                        <c:forEach var="role" items="${availableRoles}">
                            <html-el:multibox property="userRoles" styleId="${role.label}"> 
                                <c:out value="${role.value}"/>
                            </html-el:multibox> 
                            <label for="<c:out value="${role.label}"/>">
                                <c:out value="${role.label}"/>
                            </label>
                        </c:forEach>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </td>
    </tr>
    </c:when>
    <c:when test="${not empty userForm.username}">
    <tr>
        <th>
            <pgmm:label key="userForm.roles"/>
        </th>
        <td>
        <c:forEach var="role" items="${userForm.roles}" varStatus="status">
            <c:out value="${role.name}"/><c:if test="${!status.last}">,</c:if>
            <input type="hidden" name="userRoles" 
                value="<c:out value="${role.name}"/>" />
        </c:forEach>
        </td>
    </tr>
    </c:when>
</c:choose>

<c:choose>
    <c:when test="${param.from == 'list' or param.method == 'Add'}">
    <tr>
        <td></td>
        <td>
            <fieldset class="pickList">
                <legend>
                    <fmt:message key="userForm.availableDepartments"/>
                </legend>
                <table class="pickList">
                    <tr>
                        <td>
                        <c:forEach var="department" items="${availableDepartments}">
                            <c:if test="${status.count mod 5==0}"><br></c:if>
                            <html-el:multibox property="userAssignDepartments" styleId="$department.label}">
                                <c:out value="${department.value}"/>
                            </html-el:multibox>
                            <label for="<c:out value="${department.label}"/>">
                                <c:out value="${department.label}"/>
                            </label>
                        </c:forEach>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </td>
    </tr>
    </c:when>
    <c:when test="${not empty userForm.username}">
    <tr>
        <th>
            <pgmm:label key="userForm.departments"/>
        </th>
        <td>
        <c:forEach var="department" items="${userForm.assignDepartments}" varStatus="status">
            <c:out value="${department.name}"/><c:if test="${!status.last}">,</c:if>
            <input type="hidden" name="userAssignDepartments"
                value="<c:out value="${department.name}"/>" />
        </c:forEach>
        </td>
    </tr>
    </c:when>
</c:choose>
<c:choose>
    <c:when test="${param.from == 'list' or param.method == 'Add'}">
    <tr>
        <td></td>
        <td>
            <fieldset class="pickList">
                <legend>
                    <fmt:message key="userForm.approveDepartments"/>
                </legend>
                <table class="pickList">
                    <tr>
                        <td>
                        <c:forEach var="department" items="${availableDepartments}">
                            <c:if test="${status.count mod 5==0}"><br></c:if>
                            <html-el:multibox property="userApproveDepartments" styleId="$department.label}">                                
                                <c:out value="${department.value}"/>
                            </html-el:multibox>                            
                            <label for="<c:out value="${department.label}"/>">                                
                                <c:out value="${department.label}"/>
                            </label>
                        </c:forEach>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </td>
    </tr>
    </c:when>
    <c:when test="${not empty userForm.username}">
    <tr>
        <th>
            <pgmm:label key="userForm.departments"/>
        </th>
        <td>
        <c:forEach var="department" items="${userForm.approveDepartments}" varStatus="status">
            <c:out value="${department.name}"/><c:if test="${!status.last}">,</c:if>
            <input type="hidden" name="userApproveDepartments"
                value="<c:out value="${department.name}"/>" />
        </c:forEach>
        </td>
    </tr>
    </c:when>
</c:choose>
    <%-- 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>
</html:form>

<script type="text/javascript">
<!--
highlightFormElements();
<%-- if we're doing an add, change the focus --%>
<c:if test="${param.method == 'Add'}">document.forms[0].username.focus();</c:if>

function passwordChanged(passwordField) {
    var origPassword = "<c:out value="${userForm.password}"/>";
    if (passwordField.value != origPassword) {
        createFormElement("input", "hidden", 
                          "encryptPass", "encryptPass", 
                          "true", passwordField.form);
    }
}
// -->
</script>

<html:javascript formName="userForm" cdata="false"
      dynamicJavascript="true" staticJavascript="false"/>

<script type="text/javascript"
      src="<c:url value="/scripts/validator.jsp"/>"></script>


⌨️ 快捷键说明

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