上一篇:怎样成为优秀的软件模型设计者? >>
JavaScript在页面间数据传输的使用
功能描述:
从主页面把tantousyaID,edaban,torihikisakiTantousyamei三个字段传到参照子画面。参照子画面以这三个关键字为检索条件检索出符合条件的记录当把光标定在某条记录上后点击确定后即把选定的那条记录的值回传填充到主画面相应项
//************************************************************
// 主画面把参数值tantousyaID,edaban,torihikisakiTantousyamei传给参照页面
// author:zhenghy
// 2005/02/21
//*************************************************************
function doReference(){
var doc = window.document.forms[0];
var forcus_name = doc.focus_name.value;
switch (forcus_name){
case "tantousyaID"://假设光标定位在tantousyaID时有效,可据需要另设
var url = doc.context_path.value + "/contents/app/common/torihikisakitantosyasansyou/CMN080OL.jsp";
//参照页面地址
//取得tantousyaID
var strtantousyaCD = doc.tantousyaID.value;
//取得edaban
var stredaban = doc.edaban.value;
////取得torihikisakiTantousyamei
var strtorihikisakiTantousyamei = doc.torihikisakiTantousyamei.value;
var array = new Array;//将主页面取得的参数保存在一数组中
array["torihikisakiHeadCode"] = strtantousyaCD;
array["accountAdbanHead"] = stredaban;
array["tantoNameHead"] = strtorihikisakiTantousyamei;
//参照页面属性设置
var topis = (screen.height - 700) / 2;
var leftis = (screen.width - 300) / 2;
var option = "dialogLeft:" + leftis + "px;dialogTop:" + topis + "px;dialogHeight:600px;dialogWidth:600px;status:no;help:no;scroll:false;";
//从参照页面取得相应值并置入主页面的相应项中
var resDataArray = window.showModalDialog(url,array,option);
doc.torihikisakiCD.value = resDataArray["torihikisakiLineCode"];
doc.edaban.value = resDataArray["accountAdbanLine"];
doc.torihikisakiTantousyamei.value = resDataArray["tantoNameLine"];
}
}
// ************************************************************
// 参照页面
// author: zhenghy
// 2005/02/19
// ************************************************************
function doUserLoad(){
//取得从主页面传来的数据并设到参照页面的相应查询条件中
var dataArray = window.dialogArguments;
var modalForm = window.document.forms[0];
if(modalForm.change_flag.value != "load"){
modalForm.torihikisakiHeadCode.value = dataArray["torihikisakiHeadCode"];
modalForm.accountAdbanHead.value = dataArray["accountAdbanHead"];
modalForm.tantoNameHead.value = dataArray["tantoNameHead"];
modalForm.change_flag.value = "load";
modalForm.submit();
}
}
// ************************************************************
// 选中查询结果中某一项后所做的动作
// author: zhenghy
// 2005/02/19
// ************************************************************
function doSelect(){
var doc = window.document.forms[0];
var forcus_name = doc.focus_name.value;
switch (forcus_name){
case "torihikisakiLineCode":
//取得选中的torihikisakiLineCode
var strtorihikisakiLineCode = "doc." + "torihikisakiLineCode" + "[" + doc.list_start_index.value + "]" + ".value";
var torihikisakiLineCode = eval(strtorihikisakiLineCode);
//取得选中的accountAdbanLine
var straccountAdbanLine = "doc." + "accountAdbanLine" + "[" + doc.list_start_index.value + "]" + ".value";
var accountAdbanLine = eval(straccountAdbanLine);
//取得选中的tantoNameLine
var strtantoNameLine = "doc." + "tantoNameLine" + "[" + doc.list_start_index.value + "]" + ".value";
var tantoNameLine = eval(strtantoNameLine);
//把选中记录的各项值保存在一数组中返回
var array = new Array;
array["torihikisakiLineCode"] = torihikisakiLineCode;
array["accountAdbanLine"] = accountAdbanLine;
array["tantoNameLine"] = tantoNameLine;
returnValue = array;
window.close();
break;
default:
alert("请选择torihikisakiLineCode.");
}
}
}
下一篇:以“科学”和“爱国”的… >>
相关文章:
- · MySQL查询优化讲座之管理员的优化措施
- · (interbase之九)inteb…
- · Oracle数据库碎片整理
- · SQLStory摘录(七)——…
- · 使用 PHP 5.0创建图形的巧妙方法
- · 下一代的WEB开发框架
- · 推荐几篇MSDN好文章
- · Web设计里的软件工程思想
- · ASP.Net安装简明手册
- · 利用Directshow开发源Filter
- · DShow中实现抓图的几种方法
- · 渲染状态管理
- · 论游戏中的搜索问题(初级篇)
- · 如何在3D场景中加入Fog
- · 深入RPG游戏制作—图形篇
- · 角色扮演游戏的升级系统研究
- · 游戏外挂分析
- · 特效天地——水波
- · 隨筆]遊戲程式設計初學者…
- · 特效天地——位图卷轴
- · 未来游戏发展趋向
- · 纹理映射:JeffMolofee(…
- · 向3D进军:JeffMolofee(…
- · 看骂国产游戏、骂国内制…
- · 五子棋的核心算法
- · 拼图游戏的算法
- · 上楼梯算法的java实现
- · 杨辉三角形
- · 水仙花数
- · 刘徽《九章算术》中的勾股数
- · 图像分割中阈值的自动选取的研究及其算法实现
- · 【C++/OOP】(侯捷著)
- · 《Borland传奇》序-李维
- · 工作不努力,罚你去印度…
- · 《多收了三五斗》大学毕…
- · 停止思考是一种堕落--…
- · 夜幕下的程序员
- · 《各大IT公司薪金大曝光…
