emp-input.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="scripts/jquery-1.9.1.min.js"></script>
<script type="text/javascript">

$(function(){
$(":input[name=lastName]").change(function(){
var val = $(this).val();
val = $.trim(val);
var $this = $(this);

if(val != ""){
//把当前节点后面的所有 font 兄弟节点删除
$this.nextAll("font").remove();

var url = "emp-validateLastName";
var args = {"lastName":val, "time":new Date()};
$.post(url, args, function(data){
//表示可用
if(data == "1"){
$this.after("<font color='green'>LastName可用!</font>");
}
//不可用
else if(data == "0"){
$this.after("<font color='red'>LastName不可用!</font>");
}
//服务器错误
else{
alert("服务器错误!");
}
});
}else{
alert("lastName 不能为空");
$(this).val("");
$this.focus();
}
});
})

</script>
</head>
<body>


<s:debug></s:debug>


<h4>Employee Input Page</h4>


<s:form action="emp-save" method="post">
<s:if test="id != null">
<s:textfield name="lastName" label="LastName" disabled="true"></s:textfield>
<s:hidden name="id"></s:hidden>
<%-- 
<!-- 通过添加隐藏域的方式把未显式提交的字段值提交到服务器 -->
<s:hidden name="lastName"></s:hidden>
<s:hidden name="createTime"></s:hidden>
--%>
</s:if>
<s:else>
<s:textfield name="lastName" label="LastName"></s:textfield>
</s:else>

<s:textfield name="email" label="Email"></s:textfield>
<s:textfield name="birth" label="Birth"></s:textfield>

<s:select list="#request.departments"
listKey="id" listValue="departmentName" name="department.id"
label="Department">
</s:select>
<s:submit></s:submit>
</s:form>


</body>
</html>
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:cc="http://java.sun.com/jsf/composite" xmlns:lkmcc="http://java.sun.com/jsf/composite/lkmComponent" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fm="http://java.sun.com/jsf/composite/studentlist/fragement"> <cc:interface/> <cc:implementation> <style> .ui-panel .ui-panel-content { border: none !important; padding: 0.571em 0em !important; } .ui-datatable .ui-state-highlight { background-color: #bddef7 !important; color: #000 !important; font-weight: bold; } </style> <p:outputPanel> <div class="ui-fluid"> <h:panelGrid columns="4" id="toolbar"> <!-- <p:outputPanel rendered="${mis_misBoardBean.role =='管理'}">--> <!-- <div class="ui-inputgroup">--> <!-- <span class="ui-inputgroup-addon" style="width:80px;">分配人员</span>--> <!-- <p:selectOneMenu id="emp" value="#{mis_misBoardBean.query.operator}" style="width:100px;">--> <!-- <f:selectItems value="#{mis_misBoardBean.misEmpList}" var="entry" itemLabel="#{entry}"--> <!-- itemValue="#{entry}"/>--> <!-- </p:selectOneMenu>--> <!-- </div>--> <!-- </p:outputPanel>--> <p:outputPanel> <div class="ui-fluid ui-inputgroup" style="display:inline-block;line-height:normal;"> <span class="ui-inputgroup-addon" style="width:100px;">姓名</span> <!-- <p:inputText id="name" maxlength="30" class="ui-inputval" value="#{studentBean.query.name}"--> <!-- style="width:200px"></p:inputText>--> </div> </p:outputPanel> <p:outputPanel> <div class="ui-fluid ui-inputgroup" style="display:inline-block;line-height:normal;"> <span class="ui-inputgroup-addon" style="width:100px;">家庭地址</span> <!-- <p:inputText id="homeAddress" maxlength="30" class="ui-inputval" value="#{studentBean.query.homeAddress}"--> <!-- style="width:200px"></p:inputText>--> </div> </p:outputPanel> <p:outputPanel> <div class="ui-inputgroup"> <span class="ui-inputgroup-addon" style="width:80px;">有效状态</span> <!-- <p:selectOneMenu id="valid" value="#{studentBean.query.validStatus}"--> <!-- style="width:100px">--> <!-- <f:selectItem itemLabel="有效" itemValue="Y"/>--> <!-- <f:selectItem itemLabel="无效" itemValue="N"/>--> <!-- </p:selectOneMenu>--> </div> </p:outputPanel> <!-- <div class="ui-inputgroup">--> <!-- <p:selectBooleanCheckbox value="#{mis_misBoardBean.query.createByMe}" itemLabel="我创建"/>--> <!-- </div>--> <!-- <div class="ui-inputgroup">--> <!-- <p:selectBooleanCheckbox value="#{mis_misBoardBean.query.isMe}" itemLabel="我的任务"/>--> <!-- </div>--> <!-- <p:commandButton value="查询" class="query" actionListener="#{studentBean.query}"--> <!-- update="board_page" ajax="true" style="width:80px;"></p:commandButton>--> <!-- <p:commandButton value="创建" class="query" actionListener="#{studentBean.openCreateTaskDialog}"--> <!-- update="@form:createTask @form:tabView:misBoard:studentDialog" ajax="true"--> <!-- style="width:80px;"></p:commandButton>--> </h:panelGrid> <p:spacer width="10px" height="15px"/> <!-- <p:dataTable id="board_page" widgetVar="board_page" var="item" value="#{studentBean.boardList}" paginator="true"--> <!-- paginatorPosition="bottom" rows="50" reflow="true" rowIndexVar="rowvar"--> <!-- currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records"--> <!-- paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"--> <!-- rowsPerPageTemplate="50,100,150"--> <!-- selectionMode="single"--> <!-- selection="#{studentBean.selectBoardDm}"--> <!-- emptyMessage="没有数据" resizableColumns="true" lazy="true">--> <!-- <p:column width="160" headerText="操作" style="text-align:right;">--> <!--<!– rendered="#{studentBean.butAuthority('修改',item,'待完成|待回复用户')}"–>--> <!-- <p:commandLink update="@form:tabView:misBoard:createDialog"--> <!-- action="#{studentBean.studentDialog(item)}">--> <!-- <h:outputText value="修改"/>--> <!-- <p:spacer width="10px"/>--> <!-- </p:commandLink>--> <!-- </p:column>--> <!-- <p:column width="150" style="text-align:left;" headerText="姓名">--> <!-- <p:commandLink update="@form:createTask"--> <!-- action="#{studentBean.preview(item)}">--> <!-- <h:outputText value="#{item.name}" id="contentName"/>--> <!-- </p:commandLink>--> <!-- </p:column>--> <!-- <p:column width="60" style="text-align:center;" headerText="年龄">--> <!-- <h:outputText value="#{item.age}"/>--> <!-- </p:column>--> <!-- <p:column style="text-align:left;" headerText="家庭地址">--> <!-- <h:outputText value="#{item.homeAddress}" id="contentHomeAddress"/>--> <!-- <p:tooltip for="contentHomeAddress" value="#{item.homeAddress}" position="top" escape="false"--> <!-- trackMouse="true"></p:tooltip>--> <!-- </p:column>--> <!-- <p:column width="60" style="text-align:center;" headerText="有效状态">--> <!-- <h:outputText value="#{item.validStatus}"/>--> <!-- </p:column>--> <!-- <p:column width="80" sortBy="#{item.enrollmentDate}" style="text-align:center;" headerText="入学日期">--> <!-- <h:outputText value="#{studentBean.format(item.enrollmentDate)}"/>--> <!-- </p:column>--> <!-- <p:column width="80" sortBy="#{item.createTime}" style="text-align:center;" headerText="创建时间">--> <!-- <h:outputText value="#{studentBean.format(item.createTime)}"/>--> <!-- </p:column>--> <!-- <p:column width="80" sortBy="#{item.updateTime}" style="text-align:center;" headerText="更新时间">--> <!-- <h:outputText value="#{studentBean.format(item.updateTime)}"/>--> <!-- </p:column>--> <!-- </p:dataTable>--> </div> <!-- <p:dialog header="学生详情" id="studentDialog" widgetVar="studentDialog" modal="true">--> <!-- <p:outputPanel>--> <!-- <h:panelGrid columns="1">--> <!-- <p:inputTextarea value="#{studentBean.singleDm.homeAddress}" id="homeAddressContent" rows="10" cols="60" />--> <!-- <p:commandButton value="取消" style="width:80px;float:right;" oncomplete="PF('studentDialog').hide()"/>--> <!-- <p:commandButton value="保存" update="board_page" actionListener="#{studentBean.save}" />--> <!-- </h:panelGrid>--> <!-- </p:outputPanel>--> <!-- </p:dialog>--> </p:outputPanel> </cc:implementation> </html> 为什么页面只有一个姓名的标签后面都没有内容
07-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值