打开模式窗口
因为业务处理,需要打开模式窗口,因为打开的新窗口还要处理数据,所以先弹出一个div(就是坑爹的:"正在努力为您加载,还有一个雪花转啊转"),等数据加载完之后,在关闭div再打开模式窗口
业务界面:process.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <html> <head> <title>车辆基本信息</title> <script type="text/javascript"> function isdisplay3(){ document.getElementById('doing').style.visibility='visible'; //reValue接受从模式窗口返回的数据 var reValue = window.showModalDialog("/bayonetcall/ModalWindow.jsp",window,'resizable:yes;scroll:yes;status:no;dialogWidth=550px;dialogHeight=450px;center=yes;help=no'); // document.getElementById('doing').style.visibility='hidden'; } </script> </head> <body> <input type="button" value="层" onclick="isdisplay3()" /> <div id="doing" style="left: 0%; top: 0%; width: 100%; height: 100%; VISIBILITY: hidden; position: absolute; z-index: 12000;"> <table width="100%" height="100%"> <tr align="center" valign="middle"> <td> <table width="100%" height="30%" bgcolor="#E0E0E0" style="FILTER: Alpha(Opacity = 80); WIDTH: 280px; HEIGHT: 130px" border="0"> <tr align="center" valign="middle"> <td width="90%" align="center"> <img src="../images/indicator.gif"> <FONT size="2"><strong>正在加载字典项,请稍候...</strong> </FONT> </td> </tr> </table> </td> </tr> </table> </div> </body> </html>
模式窗口:ModalWindow.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript"> function funSubmit() { var dics = document.getElementsByName("dic_value"); for (i = 0; i < dics.length; i++) { //遍历Radio if (dics[i].checked) { window.returnValue = dics[i].value; window.close(); } } window.close(); } </script> </head> <body> <div class="cxdata"> <table class="jltableclass" width="100%" cellspacing="0" cellpadding="0"> <tr> <th width="50px"> 选择 </th> <th width="80px"> 序号 </th> <th> 字典项 </th> </tr> <tr> <td align='center' x> <input type="radio" name="dic_value" id="1_dic" value="男" /> </td> <td align='center'> 1 </td> <td style='text-align: center; text-indent: 4px;'> 男 </td> </tr> <tr> <td align='center' x> <input type="radio" name="dic_value" id="2_dic" value="女" /> </td> <td align='center'> 2 </td> <td style='text-align: center; text-indent: 4px;'> 女 </td> </tr> </table> <table width="100%"> <tr height="60px" valign="middle"> <td width="100%" align="center"> <a class="jlgybtn" onClick="funSubmit()">确定</a> </td> </tr> </table> </div> </body> <script type="text/javascript"> window.dialogArguments.document.getElementById('doing').style.visibility='hidden'; </script> </html>
一步一个脚印,方便自己复习,欢迎大家指正,非常感谢,共同进步!
posted on 2013-05-30 18:48 lovebeauty 阅读(541) 评论(0) 编辑 收藏 举报