
<%

	BdRelateForm bdRelateForm = new BdRelateForm();
	ArrayList listRelate = bdRelateForm.getRelateList(moduleName, formName);
    String sRelateDesc = "";
  	if (listRelate != null) { 
%>
  <form name="formPage" method="post">
  <input type="hidden" name="PKEY" value="<%=sKEY%>">  
  <input type="hidden" name="PFORM" value="<%=iFormID%>">    
  </form>
<%
  	     Iterator iterRelate = null;
  	     BdRelateFormInfo bdRelateFormInfo = null;
  	     BdRelateValue bdRelateValue = null;
  	     Collection coll = null;
  	    String value_str2[] = null;
  	    int iKeyValue = 0;
  	    int iListFieldLen = 0;
  	    int iKeyIndex = 0;
  	    int iFormID2 = 0;
  	    String strDefaultCond = "";
  	    Iterator iter = null;
  		
  		iterRelate = listRelate.iterator();
  		int i = 0;
  		while (iterRelate != null && iterRelate.hasNext()) {
  			bdRelateFormInfo = (BdRelateFormInfo)iterRelate.next();
  			bdRelateValue = new BdRelateValue(bdRelateFormInfo.getId(), 
  					SzConvert.toInt(sKEY), 
  					"0",  "",  0,  0);
  			strDefaultCond = bdRelateValue.getDefaultCond();
  			coll = bdRelateValue.getArrayList(strDefaultCond);
  			sRelateDesc = bdRelateForm.relateButton(iFormID, bdRelateFormInfo, SzConvert.toInt(sKEY));
%>
<%=sRelateDesc%>
<table width="98%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <tr class="trClassTitle">
	<%=bdRelateValue.printTableTitle()%>        	
    <td>操作</td>
  </tr>
<%
	iListFieldLen = bdRelateValue.getListFieldLen() ;
	iKeyIndex = bdRelateValue.getKeyIndex();

    if (coll != null) {
    	iter = coll.iterator();
    } else {
    	out.println("读21462 不21040 数25454 ");
    	return;
    }
    while (iter != null && iter.hasNext()) {
    	value_str2 = (String[])iter.next();
    	if (value_str2 == null) {
    		continue;
    	}
    	iFormID2 = Integer.parseInt(value_str2[0]);
    	iKeyValue = Integer.parseInt(value_str2[iKeyIndex]);
    	
    	i++;
%>
  <tr  onMouseOver="javascript:this.className='trMouseOver'" onMouseOut="javascript:this.className='trMouseOut'">
    <%=bdRelateValue.printTableValue(value_str2)%>      
    <td>
      <a href="javascript:FormSubmit(formPage,'relate_update.jsp?OPERATOR=detail&KEY=<%=iKeyValue%>&type=<%=bdRelateFormInfo.getId()%>&FormID=<%=iFormID2%>');">详细</a>
    </td>
  </tr>
<%
    } //while (iter != null && iter.hasNext()) {
%>    
</table><br>
<%
  			i++;
  		}  //while (iterRelate != null && iterRelate.hasNext()) {
  	} //if (listRelate != null) {	
%> 
