JSP中的模式对话框

 <-----------------------------mani页面-------------------------------------------------------------------------------------->

 function selectuser(){
     var selectedUsers=self.document.all("selectedUsers");
        var pinandnames = self.showModalDialog("selectTouser.jsp?   isMulti",document(1注释),"dialogWidth=600px;dialogHeight=400px;center:yes;scroll:auto;resizable:no;");   
        var userpin="",username
        if(pinandnames.length>0){
            userpin = pinandnames.substring(0,pinandnames.indexOf("[MoMoInteval]"));
            username = pinandnames.substring(pinandnames.indexOf("[MoMoInteval]")+13);
            self.document.all.casemode.value=2;
            self.document.all.isColl.checked=false;
        }
        self.document.all.echor.value = userpin;
        self.document.all.echorname.value = username;
       
    }

其上的(1注释)处的document,为父页面传递到模式对话框的一个文本对象。

 

 

<------------------------------模式对话框页面-------------------------------------------------------------------------------->

 

//操作父窗口的对象,operate(1新增 2 将父窗口的列表复制到当前列表 3删除 4全部删除)
function setSelectedUserstoParent(operate,value,text){
    // 获取参数传递的对象
    //调用父窗口的文本对像到子窗口来创建select对象
    var doc = window.dialogArguments;//取得父窗口的文本对象
    var obj = doc.all("selectedUsers");//设置变量
    switch (operate){
     case 1:
        var oOption = doc.createElement("OPTION");//
    oOption.text=text;
    oOption.value=value;
    obj.add(oOption);
      break;
     case 2:
      
      for(var i=0;i<obj.length;i++){
       var option=document.createElement("OPTION");
       option.text=obj.options[i].text;
    option.value=obj.options[i].value;
    document.all.selectSubmit.add(option);
      }
      break;
      
     case 3:
      for(var i=0;i<obj.length;i++){
       if (obj.options[i].value==value){
        obj.options[i]=null;
       }
      }
      break;
    }
    
}
 

 


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值