showModalDialog的合理使用会加速你程序的开发,下面我把我的代码贴出来分享
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.01 Transitional//EN">
<html>
<head>
<%@ include file="noCache.jsp"%>
<link rel="stylesheet" type="text/css" href="css/content.css">
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="js/jquery.datepick.js"></script>
<script type="text/javascript" src="js/jquery.datepick-zh-CN.js"></script>
<link href="css/jquery.datepick.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(
function() {
$("#ck").click(
function() {
$("[name='pageForm']").attr("action",
"CustomerAction_toaddBzwzchuku");
$("[name='pageForm']").submit();
});
});
// 时间选择器
$(document).ready(function() {
$("#dateinput2").datepick({
dateFormat : 'yy-mm-dd'
});
$("#dateinput1").datepick({
dateFormat : 'yy-mm-dd'
});
});
</script>
</head>
<body>
<div id="biaoti" class="tbtitle01">
<b>前台登记修改审计查询</b>
</div>
<div class="space_h_10"></div>
<s:form action="SampleAction_selectSampleshenji" name="pageForm" method="post">
起始时间:<s:textfield name="sj.time1" id="dateinput1"></s:textfield>
终止时间:<s:textfield name="sj.time2" id="dateinput2"></s:textfield>
<s:submit value="查询"></s:submit>
<table width="100%" border="0" cellpadding="6" cellspacing="0"
class="tb_list1">
<tr>
<th>序号</th>
<th>样品号</th>
<th>报告号</th>
<th>修改人</th>
<th>修改时间</th>
<!-- <th>修改内容</th> -->
<th>查看详细</th>
</tr>
<s:iterator value="#request.sampleshenjilist" status="st">
<tr>
<td ><s:property value="#st.index+1" /><input type="hidden" name="" value="${id }"/></td>
<td><s:property value="sample_number" /></td>
<td><s:property value="text_id" /></td>
<td><s:property value="name" /></td>
<td><s:property value="time" /></td>
<!-- <td><s:property value="content" /></td> -->
<td ><a href="#" onclick="queryDetail('<s:property value="id" />')">查看详细</a></td>
</tr>
</s:iterator>
</table>
<!-- <input type="button" value="出库" id="ck"/> -->
${page }
</s:form>
<script type="text/javascript">
function queryDetail(value){
var url = "SampleAction_selectShenjiXiangxi?id="+value;
window.showModalDialog(url,"view","dialogWidth=550px;dialogHeight=600px");
}
</script>
</body>
</html>
基本介绍:
showModalDialog() (IE 4+ 支持)
showModelessDialog() (IE 5+ 支持)
window.showModalDialog() 方法用来创建一个显示HTML内容的模态对话框。
window.showModelessDialog() 方法用来创建一个显示HTML内容的非模态对话框。
使用方法:
vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures])
vReturnValue = window.showModelessDialog(sURL [, vArguments] [,sFeatures])
参数说明:
sURL -- 必选参数,类型:字符串。用来指定对话框要显示的文档的URL。
vArguments -- 可选参数,类型:变体。用来向对话框传递参数。传递的参数类型不限,包括数组等。对话框通过
window.dialogArguments来取得传递进来的参数。
sFeatures -- 可选参数,类型:字符串。用来描述对话框的外观等信息,可以使用以下的一个或几个,用分号“;”隔开。
----------------
1. dialogHeight: 对话框高度,不小于100px
2. dialogWidth: 对话框宽度。
3. dialogLeft: 离屏幕左的距离。
4. dialogTop: 离屏幕上的距离。
5. center: { yes | no | 1 | 0 } : 是否居中,默认yes,但仍可以指定高度和宽度。
6. help: {yes | no | 1 | 0 }: 是否显示帮助按钮,默认yes。
7. resizable: {yes | no | 1 | 0 } [IE5+]: 是否可被改变大小。默认no。
8. status: {yes | no | 1 | 0 } [IE5+]: 是否显示状态栏。默认为yes[ Modeless]或no[Modal]。
9. scroll: { yes | no | 1 | 0 | on | off }:是否显示滚动条。默认为yes。