坑爹的ShowModalDialog 后台传值解决方案

访客10年前 (2015-12-16)java技术5107

 今天遇到需要ShowModalDialog打开页面,通过acceptanceIds 参数值后台过滤出相应结果

前台  

var url = "loadAcceptance.action?acceptanceIds=" + id("acceptanceIds").value ;
  var returnValue = ShowModalDialog(url,1000,600);

后台:

 public String loadAcceptance() {
  
  if (StringUtils.isNotBlank(acceptanceIds)) {
   ascceptances =  expenseService.loadAscceptances(acceptanceIds, this.getBmYear());
  }

  return "ascceptances_detail";
 }


结果:

 后台显示acceptanceIds 值为null


思考后得知ShowModalDialog 无法直接将url中的参数值传递到后台如需传递到后台需先找jsp页面进行中转处理

解决方案:

前台页面:

    var url = "popub_acceptance.jsp?acceptanceIds=" + id("acceptanceIds").value ;
  var returnValue = uf_ShowModalDialog(url,1000,600);

中转jsp页面popub_acceptance.jsp

</head>
<% 
 String ls_QueryString = request.getQueryString(); 
%>
<body bgcolor="#FFFFFF" text="#000000" leftmargin=0 topmargin=0 >
  <table width="100%" border="0" height="100%">
    <tr>
      <td>
        <iframe id=iframe_list src="loadAcceptance.action?<%=ls_QueryString%>"  frameborder=0 width=100% height="100%" scrolling="auto" align=center valign=top></iframe>
      </td>
    </tr>
  </table>
</body>
</html>

后台

 public String loadAcceptance() {
  
  if (StringUtils.isNotBlank(acceptanceIds)) {
   ascceptances =  expenseService.loadAscceptances(acceptanceIds, this.getBmYear());
  }

  return "ascceptances_detail";
 }


本文原创,转载必追究版权。

分享给朋友:

相关文章

Oracle 数据库cmd命令备份

 //导出exp wsbspt/wsbspt@192.168.1.101/wsbs file=D:/wsbspt.dmp log=D:/wsbspt.txt//导入imp &nbs...

每次开机checking file system on d

 解决方案:点击左下角(开始)- (运行)输入(CMD)回车 - 进入CMD界面- 输入(d:)回车 - 输入(chkdsk /f)中间有空格。回车,出现提示按Y键,完成后,重启一次会检...

plsql 中number类型字段 取消科学计数法显示

 PL/SQL DEVELOPER中禁用科学计数法:Tools - Prefrence - SQL Window - 选择:"Number fields to_char&quo...

js限制input只能输入数字、英文、汉字

 1.只能输入数字和英文的:  <input onkeyup="value=value.replace(/[\W]/g,'') "...

使用Myeclipse 8.5开发基于JAX-WS的Web service实例

 本文为Web service 开发入门篇,主要介绍在Myeclipse 8.5环境下开发Web service的服务程序和客户端程序的基本流程。 在Weblogic 11g...

get方式调用http接口   Header赋参数值

get方式调用http接口 Header赋参数值

   /**      195.     * 发送...

评论列表

情圣训练营
情圣训练营
10年前 (2015-12-17)

感谢分享~

汤不热营销 回复:
[招财] 必须顶的。。。。。。。。。
10年前 (2016-05-18)
亚马逊培训 回复:
发现好多东西要学
9年前 (2016-08-07)
青青草
青青草
9年前 (2017-04-26)

不错!

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。