javascript在頁面間資料轉送的使用

來源:互聯網
上載者:User
資料|頁面 功能描述:從首頁面把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.");}}}

相關文章

Beyond APAC's No.1 Cloud

19.6% IaaS Market Share in Asia Pacific - Gartner IT Service report, 2018

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。