window.jsp 获取父窗体内容并且 点击退出时候 刷新父窗体,含有trim方法

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%@ page contentType="text/html; charset=utf-8" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>选择菜单</title>
<link href="/exam2/ui/css/style_cn.css" rel="stylesheet" type="text/css">
<script src="/exam2/ui/js/jquery-1.4.2.js" type="text/javascript"></script>

<style type="text/css">
<!--
fieldset div {
    float:left;
    width:24%;
    text-align:left;
    line-height:25px;
}
td div {
    float:left;
    width:24%;
    text-align:left;
    line-height:25px;
}
-->
</style>
<script language="javascript">
String.prototype.trim = function() {
  return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}

function SelectAllBox(){
    $("input[type=checkbox][name=menuModule]").attr("checked","checked");
 }



function UnSelectAllBox(){
    $("input[type=checkbox][name=menuModule]").attr("checked",null);
}

function functionBeforeSubmit(){
     var arr=document.getElementsByTagName("input");
     var ids="";
    
     for(var i =0;i<arr.length;i++){//alert(arr[i].name=='menuModule');
        // stringObject.indexOf(searchvalue,fromindex)
            if(arr[i].value!=null&&arr[i].value.indexOf('_')>0&& arr[i].name=="menuModule"){
                    if(arr[i].checked=='checked'||arr[i].checked==true||arr[i].checked=="true"){
                        ids+=arr[i].value+",";
                    }
            }else  {
            }
         }
    
    ids=ids.substring(0,ids.length-1);
    //alert(ids);
     document.getElementById("resourceids").value=ids;
     document.getElementById("roleid").value=rowid;
     document.getElementById("ActionForm").submit();
    
}


var rowid="";
window.οnlοad=function(){
    alert(window.opener.selectedrolename);
    document.getElementById("title").innerHTML="操作1权限组:" +window.opener.selectedrolename;
    
    rowid=window.opener.selectedroleid;
    
    var resource_refids=window.opener.selectedresouce_ref;// 资源的ref ;
    
    
    var resarr=    resource_refids.split(",");

    

    
     var arr=document.getElementsByTagName("input");
     var ids="";
     for(var i =0;i<arr.length;i++){//alert(arr[i].name=='menuModule');
            if(arr[i].value!=null&&arr[i].value.indexOf('_')>0&& arr[i].name=="menuModule"){
            //    console.log(arr[i].value);    
                for(var index=0;index<resarr.length;index++){
                    
                    if(resarr[index].trim()==arr[i].value.trim()){
                        arr[i].checked='checked';
                    }else{
                        //alert(arr[i].value+"mm"+resarr[index].trim());
                    }
                }
            }else  {
            }
         }
    
}


function uploadSuccess(msg){
    alert(msg);
    
}

     //selectedrowname
   function goSelect(id){
      var valueStr=$("#"+id).val();
      var array=valueStr.split(",");
      if(array[0] != array[1]){
         if($("#"+id)[0].checked){
              var supid=array[0]+"_"+array[0];
              $("#"+ supid).attr("checked","checked");
         }else{
              var $jihe=$("input[type='checkbox'][value^="+array[0]+"]:not([value$="+array[0]+"])");
             var flag=false;
            
             $jihe.each(function(index,domEle){
                 if(this.checked){
                     flag=true;
                    return;
                 }
             });
            
             if(!flag){
                   var supid=array[0]+"_"+array[0];
                    $("#"+ supid).attr("checked",null);
             }
         }
      }
      
      if(array[0]==array[1]){
           if($("#"+id)[0].checked){
             $("input[type='checkbox'][value^="+array[0]+"]").attr("checked","checked");       
         }else{
               $("input[type='checkbox'][value^="+array[0]+"]").attr("checked",null);
         }
      }
  }
 
     function testclose(){
         
         //alert(111);
         window.opener.location.href='/exam2/admin/role/findRoleAction.action?pageSize=10&currentPage=1';
         window.close();
     }
 
 
 

    
</script>



</head>
<body>
<iframe id='frameFile' name='frameFile' style='display: none;'></iframe>
<form name="ActionForm"  id='ActionForm' target="frameFile" method="post" action="${pageContext.request.contextPath}/updateRoleResourceAction.action">
<input type="hidden" name="method" value="update">
<input type="hidden" name="roleid"  id='roleid' value="">
<input type="hidden" name="resourceids"  id='resourceids' value="">
<br/>
<div class="control">
    <button type='button' class='button' onMouseOver="this.className='button_over';" onMouseOut="this.className='button';"
            onClick="SelectAllBox()">
            <img src="/exam2/ui/images/button/quanbuxz.png" border='0'
            align='absmiddle'>&nbsp;全部选中</button>
    <button type='button' class='button' onMouseOver="this.className='button_over';" onMouseOut="this.className='button';"  
            onClick="UnSelectAllBox()">
            <img src="/exam2/ui/images/button/quanbubxz.png" border='0'
            align='absmiddle'>&nbsp;全部不选中</button>
    <button type='button' class='button' onMouseOver="this.className='button_over';" onMouseOut="this.className='button';"  
            onClick="functionBeforeSubmit();">
            <img src="/exam2/ui/images/button/baocun.png" border='0'
            align='absmiddle'>&nbsp;保存</button>
    <button type='button' class='button' onMouseOver="this.className='button_over';" onMouseOut="this.className='button';"  
            onClick="testclose()">
            <img src="/exam2/ui/images/button/guanbi.png" border='0'
            align='absmiddle'>&nbsp;关闭</button>
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#6A82A8">
    <tr>
        <td align="center" height="25"><span style="color:#FFFFFF; font-weight:bold" id='title'>操作权限组:</span></td>
    </tr>
</table>
<div class="border" style="padding:3px">
 
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td>
    
       <fieldset style='padding:5px;clear:left;'>
              <legend>
              <input type='checkbox' class='checkbox' name='menuModule' value='1,1'
                   id='company_company' onClick='goSelect(this.id)'
                           >题库
              </legend>
              
                 <div><input type='checkbox' class='checkbox' name='menuModule'  
                     value='1_1'     onClick='goSelect(this.id)'
                           id='1_1'>添加试题</div>
              
              
                 <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='1_2'    onClick='goSelect(this.id)'
                           id='1_2' >试题管理</div>
              
          
              
                 <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='1_3'     onClick='goSelect(this.id)'
                           id='1_3'>题库管理</div>
              
                 <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='1_4'   
                           id='1_4' onClick='goSelect(this.id)' >知识点管理 </div>
          
               <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='1_5'     
                           id='1_5' onClick='goSelect(this.id)' >试题类型管理 </div>
                  
                  <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='1_6'    
                           id='1_6' onClick='goSelect(this.id)' >导入试题 </div>
       </fieldset>

    
       <fieldset style='padding:5px;clear:left;'>
          <legend><input type='checkbox' class='checkbox' name='menuModule' value='2,2'
               id='sys_sys' onClick='goSelect(this.id)'
                       >试卷
          </legend>
                 <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='2_1'     
                           id='sys_group'  >添加试卷</div>
              
          
                  <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='2_2'   
                           id='sys_group'  >试卷管理</div>
                 
        
          
       </fieldset>
       
       
       
              <fieldset style='padding:5px;clear:left;'>
          <legend><input type='checkbox' class='checkbox' name='menuModule' value='3,3'
               id='plan_sd' onClick='goSelect(this.id)'
                       >考试计划
          </legend>
       
                 <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='3_1'    
                           id=''plan_sd1' onClick='goSelect(this.id)' >添加计划</div>
              
                   <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='3_2'    
                           id='' onClick='goSelect(this.id)' >计划管理</div>
                           
                                    <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='3_3'    
                           id='plan_pingjuan_byhand' onClick='goSelect(this.id)' >人工评卷</div>
              
                           <div><input type='checkbox' class='checkbox' name='menuModule'
                                 value='3_4'  
                           id='plan_score_manage' onClick='goSelect(this.id)' >成绩管理</div>
              
        <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='3_5'    
                           id='plan_watch_manage' onClick='goSelect(this.id)' >监控</div>
                           
                                  
        <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='3_6'    
                           id='plan_watch_student' onClick='goSelect(this.id)' >考生监控</div>
          
       </fieldset>
       
       
       

       <fieldset style='padding:5px;clear:left;'>
          <legend><input type='checkbox' class='checkbox' name='menuModule' value='4,4'
               id='report_report' onClick='goSelect(this.id)'
                         >用户 / 组 / 权限
          </legend>

                 <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='4_1'    
                           id='report_khflfx' onClick='goSelect(this.id)' >添加用户</div>
              
                 <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='4_2'     
                           id='report_khflfx' onClick='goSelect(this.id)' >用户管理</div>
          
              
                 <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='4_3'   
                           id='report_khfx2' onClick='goSelect(this.id)' >组管理</div>
              
                 <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='4_4'   
                           id='report_khfx1' onClick='goSelect(this.id)' >数据权限管理</div>
                           
                           
                 <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='4_5'    
                           id='report_khfx3' onClick='goSelect(this.id)' >角色管理</div>
                           
       </fieldset>
       
       
       
          <fieldset style='padding:5px;clear:left;'>
          <legend><input type='checkbox' class='checkbox' name='menuModule' value='5,5'
               id='asy_dfd' onClick='goSelect(this.id)'
                       >统计分析
          </legend>
       
       
                 <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='5_1'   
                           id='asy_group' onClick='goSelect(this.id)' >考试成绩分析</div>
              
          
                  <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='5_2'     
                           id='asy_analyze' onClick='goSelect(this.id)' >考试正确率分析</div>
        
            <div><input type='checkbox' class='checkbox' name='menuModule'
                     value='5_3'    
                           id='5_3' onClick='goSelect(this.id)' >考试明细分析</div>
                 
       </fieldset>
</td>
    </tr>
</table>

</div>
</form>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值