<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.Collection" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ page import="net.sz600.system.*" %>
<%@ include file="/sessionInfo.jsp"%>
<%
	String moduleName = SzConvert.toSpaceStr(request.getParameter("moduleName"));
	String formName = SzConvert.toSpaceStr(request.getParameter("formName")); 
	String sRelateValue = SzConvert.toSpaceStr(request.getParameter("relateValue"));
	String sRriggerName = SzConvert.toSpaceStr(request.getParameter("triggerName"));
	
	BdReadSelectXML2 readSelectXML = new BdReadSelectXML2();
	//获取已经设置的详细信息
	BdSelectControl2 bdSelectControl = new BdSelectControl2(sRriggerName);
	BdSelectTableInfo2 tableInfo = bdSelectControl.getTableInfo();
	//取得已经填写的值
%>
<%
    int i = 0;
    int j = 0;
	//必须要把这个值传过来（或者
	//取得关联的值

	String s_info[] = bdSelectControl.getInfo(sRelateValue);		
	int iFieldLen = bdSelectControl.getFieldLen();

	//取得控件ID
	String obj_str[] = bdSelectControl.getObjStr();
%>
<script language="javascript">
    var objCount;
    objArray = new Array();
    objCount = 0;  
    var valueArray = new Array();
<%
    int iObjCount = 0;
    if (obj_str != null) {
    	iObjCount = obj_str.length;
    }
    for (i =0; i<iObjCount; i++) {
%>
        objArray[objCount] = new Array("<%=obj_str[i]%>");  
        valueArray[objCount] = new Array("<%=s_info[i]%>");         
        objCount++;
<%    	
    }    	
%> 
</script>
<form name="formHidden">
  <input type="button" value="测试" onClick="javascript:FunOk();">
</form>

<script language="javascript">
  function FunOk() {

    //确定，获取
    var vName = "";
    var vId = "0";
    var j = 0;
    
    var k = 0;
    
    //var oWindow = window.dialogArguments;
    var oWindow = window.opener;
    var objName = "";
    var obj = null;
    
    for (k=0; k<objCount; k++) {        
        if (objArray[k] == "" || objArray[k] == null ) {
        	continue;
        }
        
		objName = "formUpdate." + objArray[k];		
		//判断objName的类型		
      	if (objName != "") {
      		obj = eval("oWindow." + objName);
      		if (obj != null && obj.id != null) {
      			eval("oWindow." + objName + ".value='" + valueArray[k] + "';");
      		} else {
      		    //CheckRadio(obj, valueArray[k]);
      		    oWindow.test(objArray[k], valueArray[k]);
      		}

      	}
    }    
    window.close();

  }
  
  FunOk();
</script>
