CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Java >  Web 开发

关于模态窗口刷新父窗口传递参数的问题

楼主bolton123()2005-03-03 23:55:02 在 Java / Web 开发 提问

我的问题是当我门打开一个模态窗口的时候,关闭模态窗口我门可以获得子窗口传递过来的参数,我现在实现了在子窗口里点"确定"以后子窗口关闭,父窗口刷新,这样刷新以后就不能保存原来子窗口传递过来的参数,真的不行了,哪个大侠帮帮忙啊我的代码如下:  
  <%@   page   contentType="text/html;   charset=gb2312"   %>  
   
   
  父页面  
  <html>  
  <head>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  <title></title>  
  <link   href="../analysis/css/main.css"   rel="stylesheet"   type="text/css">  
  <script   type="text/javascript"   src="../js/calendar.js"></script>  
  <script   language="javascript">  
    var   CalendarWebControl   =   new   atCalendarControl();  
  </script>  
  </head>  
  <script   language="javascript">  
  //打开选择县市窗口  
  function   addCounty(){  
  var   tempBussinessId   =   new   Array;//传递已经选好的业务编号以便于进行比较  
  var     tempCountyId   =   new   Array;//当再次打开窗口时为了看到以前勾选的内容必须传递前次勾选县市编号  
  var   countyId   =   '';  
  var   aaa;  
  alert("BaseDataForm.countyId.value="+document.BaseDataForm.countyId.value);  
  //alert("BaseDataForm.bussinessId.value="+BaseDataForm.bussinessId.value);  
  //将已经选择的业务转化为数组  
  if   (BaseDataForm.bussinessId.value   !=   'undefined'   &&   BaseDataForm.bussinessId.value.length   >   1)   {  
                  tempBussinessId   =   BaseDataForm.bussinessId.value.split(',');  
  }  
  //将已经选择的县市转化为数组  
  if   (BaseDataForm.countyId.value   !=   'null'   &&   BaseDataForm.countyId.value   !=   'undefined')   {  
  alert("进来了");  
      tempCountyId   =   BaseDataForm.countyId.value.split(',');  
  }  
  //alert("数组tempCountyId长度为"+tempCountyId.length);  
  //alert("数组tempBussinessId长度为"+tempBussinessId.length);  
   
  var   tempBC   =   new   Array(tempBussinessId,tempCountyId);  
    aaa   =   window.showModalDialog("../analysis/SelectCounty.jsp?aaa=1",tempBC,  
  "dialogHeight:   400px;   dialogWidth:   200px;dialogTop:   150px;   dialogLeft:   500px;center:   No;resizable:   Yes;"   );  
  document.BaseDataForm.countyId.value   =   aaa;  
  if   (aaa   !=   undefined)   {  
  document.BaseDataForm.countyId.value   =   aaa;  
        window.location.reload(1);  
    }  
  document.BaseDataForm.countyId.value   =   aaa;  
  alert("BaseDataForm.countyId.value="+document.BaseDataForm.countyId.value);  
  }  
   
  //打开选择业务窗口  
  function   addBussiness(){  
  var     tempCountyId   =   new   Array;  
  var     bbb;  
  if   (BaseDataForm.countyId.value   !=   'undefined'   &&   BaseDataForm.countyId.value.length   >   1)   {  
                  tempCountyId   =   BaseDataForm.countyId.value.split(',');  
  }  
    bbb   =   showModalDialog("../analysis/SelectBussiness.jsp?type=0&aaa=1",tempCountyId,  
  "dialogHeight:   400px;   dialogWidth:   220px;dialogTop:   150px;   dialogLeft:   715px;center:   Yes;resizable:   Yes;"   );  
                  BaseDataForm.bussinessId.value   =   bbb;  
                  if   (bbb   !=   undefined)   {  
        window.location.reload(1);  
    }  
  }  
   
  //显示图表  
  function   showGraph(content){  
  if   (BaseDataForm.Sys_BeginDate.value   ==   "")   {  
  alert("请输入开始时间!");  
  return   false;  
                  }  
  if   (BaseDataForm.Sys_EndDate.value   ==   "")   {  
  alert("请输入结束时间!");  
  return   false;  
                  }  
  if   (BaseDataForm.countyId.value   ==   null   ||   BaseDataForm.countyId.value   ==   'null'   ||   BaseDataForm.countyId.value   ==   ''   ||   BaseDataForm.countyId.value   ==   'undefined')   {  
          alert("请选择县市!");  
  return   false;  
                  }  
  if   (BaseDataForm.bussinessId.value   ==   null   ||   BaseDataForm.bussinessId.value   ==   'null'   ||   BaseDataForm.bussinessId.value   ==   ''   ||   BaseDataForm.bussinessId.value   ==   'undefined')   {  
          alert("请选择业务!");  
  return   false;  
      }  
  BaseDataForm.action   =   "/selectquerydata?type="+content;  
  return   true;  
  }  
   
  </script>  
  <body>  
  <form   name="BaseDataForm"   method="post">  
  <table   width="100%"   height="38"   border="0"   cellpadding="0"   cellspacing="0"   background="images/bg_toptitl.gif">  
      <tr>  
          <td   width="48"><img   src="images/tb_tit_sj.gif"   width="40"   height="29"   align="absmiddle"></td>  
          <td   width="94%"><span   class="titcolor">全市发展情况基础数据表 </span>&nbsp;显示各县市分公司每天各品牌各种服务计划的业务发展情况</td>  
      </tr>  
  </table>  
                  <img   src="../analysis/images/buttonl_selectcounty.gif"   align="absmiddle"   onclick="return   addCounty();">   
                  <img   src="../analysis/images/buttonl_selectoperation.gif"   align="absmiddle"   onclick="return   addBussiness();">   
                  </span></td>  
          </tr>  
      </table>  
      <table   width="100%"   height="38"   border="0"   cellpadding="0"   cellspacing="0"   background="images/showtitbg.gif">  
          <tr>  
              <td   width="59%"   height="38"   align="center">选择数据图浏览类型   (   默认类型:数据表格   )</td>  
              <td   width="41%"   align="right"><table   width="100%"   border="0"   cellspacing="0"   cellpadding="0">  
                  </table></td>  
          </tr>  
      </table>  
      <table   width="100%"   height="490"   border="0"   cellpadding="0"   cellspacing="0">  
      <tr>  
          <td   valign="top">  
  </table>  
  <input   type="hidden"   name="countyId"   value="<%=strTempCountyId%>">  
  <input   type="hidden"   name="bussinessId"   value="<%=strTempBussinessId%>">  
  </form>  
  </body>  
  </html>  
   
  子页面  
  select_county:  
  <html>  
  <head>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  <title></title>  
  <link   href="css/main.css"   rel="stylesheet"   type="text/css">  
  <script   type="text/javascript"   src="../js/select.js"></script>  
  </head>  
  <script   language="javascript">  
    function   sendTo(){  
  var   CountyId   =   '';  
  var   tempBussinessId   =   new   Array;//业务  
  var   tempDealerId   =   new   Array;//运营商  
  var   tempCountyId   =   new   Array;//县市  
  var   tempArray   =   new   Array;  
  var   count   =   0;  
   
  for(var   i=0;i<form1.select_county.length;i++){  
  if   (document.form1.select_county[i].checked   ==   true)  
    {  
  count   =   count   +   1;  
          CountyId   =   CountyId   +   document.form1.select_county[i].value   +   ',';  
      }  
  }  
  if   (form1.num.value   ==   '1')   {  
  var   tempBC   =   new   Array(tempBussinessId,tempCountyId);  
  tempBC   =   window.dialogArguments;//存放传递过来的业务编号和县市编号  
  tempBussinessId   =   tempBC[0];//业务  
  tempCountyId   =   tempBC[1];//县市  
  alert("tempCountyId.value.length="+tempCountyId.value.length);  
  for(var   i=0;i<form1.select_county.length;i++){  
  for(var   k=0;k<tempCountyId.length;k++){  
  if(tempCountyId[k].value   ==   form1.select_county[i].value){  
  document.form1.select_county[i].checked   ==   true;  
  }  
  }  
  }  
  if   (tempBussinessId.length   -   1   >   1   &&   count   >   1)   {  
          alert("业务已经多选,县市目前只能单选!");  
      }  
    }  
  if   (form1.num.value   ==   '2')   {  
        tempArray   =   window.dialogArguments;  
  tempBussinessId   =   tempArray[0];  
  tempDealerId   =   tempArray[1];  
  if   (tempBussinessId.length   -   1   >   1   &&   count   >   1)   {  
          alert("业务县市已经多选,县市目前只能单选!");  
      }  
  if((tempDealerId.length   -   1)   >   1   &&   count   >   1){  
  alert("运营商已经多选,县市目前只能单选!");  
  return   false;  
  }  
    }  
   
  if(tempCountyId   ==   ''){  
  alert("请选择县市!");  
  return   false;  
  }  
  window.returnValue   =   tempCountyId;  
  window.close();  
  }  
  </script>  
  <body>  
  <form   name="form1">  
      <table   border="0"   cellspacing="12"   cellpadding="0">  
          <tr>  
              <td><table   border="0"   cellpadding="0"   cellspacing="8"   class="maintablekuang">  
                  </table></td>  
              <td   valign="middle">  
                  <table   width="100%"   border="0"   cellspacing="0"   cellpadding="0">  
                      <tr>  
                          <td><img   src="images/buttonl_selectall.gif"   width="63"   height="21"   border="0"   onclick="selectAll()"></td>  
                      </tr>  
                      <tr>  
                          <td>&nbsp;</td>  
                      </tr>  
                      <tr>  
                          <td><img   src="images/buttonl_selectallno.gif"   width="63"   height="21"   border="0"   onclick="clearAll()"></td>  
                      </tr>  
                      <tr>  
                          <td>&nbsp;</td>  
                      </tr>  
                      <tr>  
                          <td><img   src="images/button_confirm.gif"   width="63"   height="21"   border="0"   onclick="sendTo()"></td>  
                      </tr>  
                  </table>  
              </td>  
          </tr>  
      </table>  
  <input   type="hidden"   name="num"   value=<%=weiNum%>>  
  </form>  
  </body>  
  </html>  
  问题点数:0、回复次数:1Top

1 楼awaysrain(绝对零度)(既然选择了远方就要日夜前行)回复于 2005-03-04 08:53:31 得分 0

呵呵,你刷新了页面当然参数会丢了,想办法在页面刷新前保存参数然,比如用cookie等Top

相关问题

  • 两个模态对话框的变量怎么传递参数?
  • 急:用session向模态窗口传递参数出错
  • 请教:模态窗口在Page_load过程中如何获得父页面传递过来的参数?
  • 两个页面之间的参数传递及同步刷新问题
  • 参数传递
  • 参数传递
  • 参数传递
  • 参数传递
  • 传递参数?
  • 参数传递

关键词

  • 数据
  • 类型
  • 发展情况

得分解答快速导航

  • 帖主:bolton123

相关链接

  • CSDN Java频道
  • Java类图书
  • Java类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo