• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: 小 中 大 | 推荐给好友 上一篇 | 下一篇

javascript在页面间数据传输的使用

发布: 2007-7-01 18:47 | 作者: admin | 来源: | 查看: 23次 | 进入软件测试论坛讨论

领测软件测试网 功能描述:从主页面把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.");}}}

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:[email protected] 电话:010-51297073

软件测试 | 领测国际 | ISTQB | ISTQB官网 | TMMi | TMMi认证 | 国际软件测试工程师认证 | 领测软件测试网