emis相关的一些备忘
来源:互联网 发布:神武2手游多开软件 编辑:程序博客网 时间:2024/05/02 02:41
1、参数传递问题
如果我点某个按钮打开一个JSP页面,参数写在这个URL地址的后边,页面里边有z:init方法,我想把参数再继续传递给z:init调用的方法,可以使用如下途径:
<script type="text/javascript">
Page.onLoad(function(){
<%request.setAttribute("ParentID", request.getParameter("ParentID"));%>
});
}
</script>
就是在页面加载时将参数设置到请求中去,这样z:init方法在后台就可以直接取到这个参数了:
public static Mapx initTypeDialog(Mapx params) {
String parentID = params.getString("ParentID");
if ((parentID == null) || (parentID.equals("0")) || (StringUtil.isEmpty(parentID))) {
params.put("Prop1", HtmlUtil.codeToOptions("ThingType", true));
} else {
ZCCatalogSchema pCatalog = new ZCCatalogSchema();
pCatalog.setID(parentID);
pCatalog.fill();
params.put("Prop1", HtmlUtil.codeToOptions("ThingType", pCatalog.getProp1()));
}
return params;
}
2、通过url传递给一个页面,如果这个页面要导出excel,则在页面的onload事件中,需要给dga设置传入的参数,否则即使查询条件部分定义了相关参数的输入域,导出时也取不到传入的值:
Page.onLoad(function(){
//url传入的参数,一定要在这里设置下,不然即使下边的查询条件有传入的参数,导出时也会取不到传入参数的值,导致导出Excel数据有问题
DataGrid.setParam("dg1", "ThingStatus", "<%=request.getParameter("ThingStatus")%>");
DataGrid.setParam("dg1", "Bads", "<%=request.getParameter("Bads")%>");
});
查询部分:
<tr>
<td style="padding:8px 10px;">
<!--<z:tbutton onClick="print()"><img src="../../Icons/icon018a4.gif" />打印</z:tbutton>-->
<div style="float: left white-space: nowrap;">
<input type="hidden" name="ThingStatus" id="ThingStatus" value="<%=request.getParameter("ThingStatus") %>" />
<input type="hidden" name="Bads" id="Bads" value="<%=request.getParameter("Bads") %>" />
<span >
<strong>制单日期</strong> <input type="text" id="StartDate" name="StartDate" size="13" ztype="Date" class="inputText" value="${StartDate}">
<strong>至</strong> <input type="text" id="EndDate" name="EndDate" size="13" ztype="Date" class="inputText" value="${EndDate}">
</span>
<strong>类型:</strong><z:select id="ThingType" name="ThingType" style="width:70px" onChange="changeCondition()">${ThingType}</z:select>
<strong>仓库:</strong><z:select id="WarehouseID" name="WarehouseID" style="width:100px" listWidth="80" onChange="changeCondition()">${WarehouseID}</z:select>
<strong>状态:</strong><z:select id="Status" style="width:70px" onChange="changeCondition()">${Status}</z:select>
<input type="text" id="SearchCode" name="SearchCode" value="请输入单号" onFocus="delKeyWord();" style="width:90px">
<input type="text" id="SearchCode1" name="SearchCode1" value="请输入品名或编码" onFocus="delKeyWord();" style="width:90px">
<input type="button" name="Submitbutton" id="Submitbutton" value="查询" onClick="doSearch()"></div>
</td>
</tr>
url参数:StoreInQuery.jsp?ThingStatus=0&Bads=0
- emis相关的一些备忘
- 备忘:和公钥私钥证书相关的一些帖子
- CVS的一些备忘
- 自己的一些备忘
- 一些简单的备忘
- 一些常用的备忘
- 享购网的相关公告 备忘
- firefox的一些设置备忘
- 关于MySQL的一些备忘
- 安装archlinux的一些备忘。。
- flex 4 的一些备忘
- fuse的一些理解-备忘
- 关于BCB的一些备忘
- 类型转换的一些备忘
- MAC的一些设置备忘
- 关于IIC的一些备忘
- MySQL的一些备忘技巧
- ubuntu的一些使用备忘
- with check option
- Struts2三种传参方式(从jsp页面传到Action)
- 后天网选
- android Service 之Bound Service
- How Browsers Work:Behind the Scenes of Modern Web Browser
- emis相关的一些备忘
- 生产者与消费者模型Linux下C语言的实现
- 完善计算机体系知识
- 随笔一篇
- ASP.NET程序向Event Viewer写入Event Log
- Effective C++读书笔记之二
- 傅里叶变换在图像处理中的应用
- C#学习笔记16——.net中System.Security.Cryptography 命名空间
- Unity3D 学习