日期:2014-05-19 浏览次数:20688 次
function selectCooperate(obj){ var userObject=new Object(); userObject.userString=document.getElementById(obj).value; var selectUrl="${ctx}/DispatchAction.do?efFormEname=UITM25&serviceName=TMTask&methodName=selectAssistantUser&orgcode=&orgcodeFilter=${data.rootorg }&taskGuid=${data.taskparentguid}&allLeader=&random="+Math.random(); window.open(selectUrl,'newwindow','height=300,width=1000,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no'); var a =document.getElementById("i-0-valueString").value; if(a!=undefined){ document.getElementById(obj).value=a; selectCooperate_view(obj+"_view",a); } }
function okOrgUser(){ var users=document.getElementById("user_select"); var userString=""; for(var i=0;i<users.options.length;i++){ var currentOption=users.options[i]; if(i!=0) userString+=";"; userString+=currentOption.value+","; userString+=currentOption.userName+","; userString+=currentOption.orgcode+","; userString+=currentOption.orgname; } window.opener.document.getElementById("i-0-valueString").value=userString; //i-0-valueString 父页面中的文本框 window.close(); }
var a =document.getElementById("i-0-valueString").value; if(a!=undefined){ document.getElementById(obj).value=a; selectCooperate_view(obj+"_view",a); }
------解决方案--------------------
不要直接从子窗口操作父窗口的节点属性,尝试改为调用父窗口的所提供的函数(理解为回调函数),父窗口自己的这个回调函数来负责修改自己的值,你的这些代码也放入该回调函数中:
var a =document.getElementById("i-0-valueString").value;
if(a!=undefined){
document.getElementById(obj).value=a;
selectCooperate_view(obj+"_view",a);
}