欢迎光临
我们一直在努力

JavaScript在页面间数据传输的使用-JSP教程,Java技巧及代码

建站超值云服务器,限时71元/月

功能描述:从主页面把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.");}}}

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » JavaScript在页面间数据传输的使用-JSP教程,Java技巧及代码
分享到: 更多 (0)