简单实用的form表单和list页面

list页面

<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>Baseline Management</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	function page(n, s) {
		if (n)
			$("#pageNo").val(n);
		if (s)
			$("#pageSize").val(s);
		$("#searchForm").attr("action", "${ctx}/ito/commonbaseline/list");
		$("#searchForm").submit();
		return false;
	}

	function myreset() {
		$(':input', '#searchForm').not(':button, :submit, :reset, :hidden')
				.val('').removeAttr('checked').removeAttr('selected');
		$("#searchForm").submit();
		return false;
	}
</script>
<style type="text/css">
.table thead tr th, .table thead tr td {
	vertical-align: middle;
	text-align: center;
}

.select {
	width: 280px;
}
</style>
</head>


<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/delivery/resourceinfo/list">List</a></li>
		<shiro:hasPermission name="delivery:projectBasic:edit">
			<li><a href="${ctx}/delivery/resourceinfo/form">Add</a></li>
		</shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="dpmResourceInformation"
		action="${ctx}/delivery/resourceinfo/" method="post"
		class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
		<input id="pageSize" name="pageSize" type="hidden"
			value="${page.pageSize}" />
		<li><label>类型:</label> <form:select id="type" path="type" class="input-medium select">
				<form:option value="">----select----</form:option>
				<form:option value="HS">人力来源</form:option>
				<form:option value="WP">工作场所</form:option>
			</form:select>
			</li>
		<li><label>名称:</label> <form:input path="name" htmlEscape="false" class="input-medium" /></li>

		<input id="btnSubmit" class="btn btn-primary" type="submit"
			value="Search" />
		<input class="btn btn-primary" type="button" value="Reset"
			onclick="return myreset();" />
	</form:form>
	<sys:message content="${message}" />
	<table id="contentTable"
		class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>No</th>
				<th>项目名称</th>
				<th>类型</th>
				<th>名称</th>
				<th>sort</th>
				<th>rmarks</th>
				<shiro:hasPermission name="delivery:projectBasic:edit">
					<th>操作</th>
				</shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${page.list}" var="projectBasic" varStatus="status">
				<tr>
					<td>${(status.index+1)+(page.pageNo-1)*page.pageSize}</td>
					<td><a
						href="${ctx}/delivery/resourceinfo/form?id=${projectBasic.id}">${projectBasic.projectName}</a></td>
					<td>${projectBasic.type}</td>
					<td>${projectBasic.name}</td>
					<td>${projectBasic.sort}</td>
					<td>${projectBasic.remarks}</td>
					<shiro:hasPermission name="delivery:projectBasic:edit">
						<td><a
							href="${ctx}/delivery/resourceinfo/form?id=${projectBasic.id}">[edit]</a>
							<a href="${ctx}/delivery/resourceinfo/delete?id=${projectBasic.id}" onclick="return confirmx('Do you want to delete the dictionary?', this.href)">[delete]</a>
						</td>
					</shiro:hasPermission>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>

form表单页面

<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>Baseline Management</title>
<meta name="decorator" content="default" />
<style type="text/css">
.left {
	float: left;
	clear: left;
	width: 40%;
}

.right {
	float: left;
	padding-left: 20px;
}

.select {
	width: 220px;
}
</style>
<script type="text/javascript">
		$(document).ready(function() {
			$("#value").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('Submitting, please wait...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("Input incorrectly, please correct it.");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						if(element.is(".my_add-on")){
							error.insertAfter(element.next());
						}else{
							error.insertAfter(element);
						}
					}
				}
			});
		});
		
		
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/delivery/resourceinfo/list">List</a></li>
		<li class="active"><a
			href="${ctx}/delivery/resourceinfo/form?id=${dpmResourceInformation.id}"><shiro:hasPermission
					name="delivery:projectBasic:view">${not empty dpmProjectBasic.id?'Edit':'Add'}</shiro:hasPermission>
		</a></li>
	</ul>
	<br />
	<form:form id="inputForm" modelAttribute="dpmResourceInformation"
		action="${ctx}/delivery/resourceinfo/save" method="post"
		class="form-horizontal">
		<form:hidden path="id" />
		<sys:message content="${message}" />




		<div class="control-group">
			<label class="control-label">项目名称:</label>
			<div class="controls">
				<form:select path="projectBasicId" htmlEscape="false"
					style="width:220px" class="required">
					<form:option value="">----select----</form:option>
					<form:options items="${projectList}" itemLabel="projectName"
						itemValue="projectBasicId" />
				</form:select>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>


		<div class="control-group">

			<label class="control-label">名称:</label>
			<div class="controls">
				<form:input path="name" htmlEscape="false" maxlength="50"
					class="required" />
				<span class="help-inline"><font color="red">*</font> </span>
			</div>


		</div>

		<div class="control-group">
			<label class="control-label">类型:</label>
			<div class="controls">
				<form:select id="type" path="type" class="input-medium select">
					<form:option value="">----select----</form:option>
					<form:option value="HS">人力来源</form:option>
					<form:option value="WP">工作场所</form:option>
				</form:select>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>


		<div class="control-group">
			<label class="control-label">sort:</label>
			<div class="controls">
				<form:input path="sort" htmlEscape="false" maxlength="50"
					class="required" />
				<span class="help-inline"><font color="red">*</font> </span>
			</div>

		</div>
		<div class="control-group">
			<label class="control-label">Remark:</label>
			<div class="right">
				<form:textarea path="remarks" htmlEscape="false" rows="3"
					maxlength="200" class="input-xlarge" />
			</div>
		</div>


		<div class="form-actions">
			<shiro:hasPermission name="delivery:projectBasic:edit">
				<input id="btnSubmit" class="btn btn-primary" type="submit"
					value="Save" />&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="Back"
				onclick="history.go(-1)" />
		</div>
	</form:form>
</body>
</html>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值