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

访客11年前 (2015-12-16)java技术6175

 今天遇到需要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";
 }


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

分享给朋友:

相关文章

js动态加载复选框checkbox(XML串)

 首先,使用JS动态产生Checkbox可以采用如下类似的语句:代码如下:var checkBox=document.createElement("input");che...

jquery 操作html元素(及CSS)

jquery 操作html元素(及CSS)

 $("li").addClass("aui-user-view-cell aui-img") ;  //给元素添加样式$('#a1...

目标管理法——目标分解法

让自己的人生更幸福更有意义关键是:要将梦想转化为具体的目标,然后合理的分解,达到量化,指标化!现将学习到的两种非常有效的目标分解法分享给所有梦想、有激情的朋友:祝愿大家都能梦想成真! 一、俄...

dwz +jfinal 批量多文件上传 实例

页面部分:<link href="${root}/style/dwz/uploadify/css/uploadify.css" rel="sty...

dwz+jfinal 市县下拉菜单二级联动(实例)

在DWZ文档中对组合框combox的是这样描述的:在传统的select 用class 定义:class=”combox”, html 扩展:保留原有属性name,  增加了属性:ref。re...

评论列表

发表评论

访客

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