外层的代码<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/webacd.tld" prefix="webacd" %>
<%@ page language="java" %>
<bean:parameter id="formObj" name="formObj" value=""/>
<bean:define id="ACDSelectAgentForm" name="ACDSelectAgentForm" type="com.webex.webapp.webacd.action.preferences.ACDSelectAgentForm"/>
<script language=javascript>
function DoAction(Action,Index)
{
     switch(Action)
     {
            case "Index":
                 document.agentdetails.ACDSelectAgentForm.AT.value = "Index";
                 document.agentdetails.ACDSelectAgentForm.index.value = Index;
                 document.agentdetails.ACDSelectAgentForm.submit();
              break;
            case "Search":
                 var SearchSrting=document.forms[0].searchTopic.value;
                 if(SearchSrting.length==0)
                 return false;
                 document.agentdetails.ACDSelectAgentForm.AT.value = "Search";
                 document.agentdetails.ACDSelectAgentForm.searchTopic.value = SearchSrting;
                 document.agentdetails.ACDSelectAgentForm.submit();                 return true;
                break;
     }}</script><html:html locale="true">
<html:base/>
<head>
<link rel="stylesheet" href='<%= request.getContextPath()+"/webacd/html/css/webacdbrand.css" %>' type="text/css">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title><bean:message key="webacd.preferences.title"/></title>
</head><body>
 <html:form action="/agentlist">
  <table width="100%"  border="0" cellpadding="0" cellspacing="0">
    <tr>
     <td class="title1"><bean:message key="webacd.preferences.title"/></td>
    </tr>
  </table>
  <table width="100%"  border="0" cellpadding="0" cellspacing="0">
    <tr>     <td width="96%" height="45">
        <html:text  property="searchTopic" />
        <input type="button" name="search" value='<bean:message key="webacd.preferences.button.search"/>' onclick="DoAction('Search','')">
     </td>
    </tr>
    <tr>
      <td colspan=2>
         <html:hidden property="index" />
      </td>
    </tr>
  </table>
  <table width="100%"  border="0" cellpadding="0" cellspacing="0">
    <tr>
     <td width="2%" valign="top">
        <table width="17"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="17" align="center" bgcolor="#EEEEEE" class="addressbookalphabet">
             <webacd:AgentList action="letter" index="<%=ACDSelectAgentForm.getIndex()%>"/>
            </td>
           </tr>
          </table>
         </td>
         <td width="1%">&nbsp;&nbsp;&nbsp;</td>
         <td width="97%" valign="top"><iframe id="agentdetails" name="agents" height="380" width="98%" src="/webacd/listagent.do" frameborder="1" scrolling="auto"></iframe>
          <table width="98%" cellspacing="4">
            <tr>
             <td align="right">               <html:button property="cancel" onclick="window.close()"><bean:message key="webacd.preferences.button.cancel"/></html:button>
             </td>
            </tr>
          </table>
         </td>
        </tr>
      </table>
</html:form>
</body>
</html:html>iframe 里面的代码
<%--
  - @(#) userlist.jsp
  - Description: List user details in the site
  - Copyright: Copyright (C) 2004 All rights reserved
  - Company: WebEx Communications Inc.
  - Author(s): Vicent Wang <[email protected]>
   --%><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/webacd.tld" prefix="webacd" %>
<%@ page language="java" %>
<bean:define id="ACDSelectAgentForm" name="ACDSelectAgentForm" type="com.webex.webapp.webacd.action.preferences.ACDSelectAgentForm"/>
<script language="javascript" src='<%=request.getContextPath()+"/webacd/html/js/string.js"%>'></script>
<script language=javascript>
function getUserEmail()
{
     var strMatrix="";
     len =document.form.elements.length;     for(var i=0; i < len; i++)
     {
         if(form.elements[i].type=="checkbox"&&form.elements[i].checked)
         strMatrix+=document.forms[0].elements[i].value+";";
     }
    return strMatrix;
}
</script><html:html locale="true">
<head><html:base/>
<link rel="stylesheet" href='<%= request.getContextPath()+"/webacd/html/css/webacdbrand.css" %>' type="text/css">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title><bean:message key="webacd.preferences.title"/></title>
</head><body>
 <html:form action="/listagent">
<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="tabTable">
   <tr>
     <tr height=22 class="tabTable">
       <html:hidden name="ACDSelectAgentForm" property="searchTopic"/>
       <html:hidden name="ACDSelectAgentForm" property="AT"/>
       <html:hidden name="ACDSelectAgentForm" property="index"/>
       <td nowrap WIDTH=3% ALIGN="LEFT" valign="bottom" class="title5">&nbsp;&nbsp;
       </td>
       <td nowrap WIDTH=30% ALIGN="LEFT" valign="bottom" class="title5">
         <bean:message key="webacd.preferences.name"/>
       </td>
       <td nowrap WIDTH=37% ALIGN="LEFT" valign="bottom" class="title5">
         <bean:message key="webacd.preferences.email"/>
       </td>
       <td nowrap WIDTH=30% ALIGN="LEFT" valign="bottom" class="title5">
         <bean:message key="webacd.preferences.username"/>
   </tr>    <logic:iterate id="user"  name="ACDSelectAgentForm" property="agentList" type="com.webex.webapp.common.vo.user.User">
     <tr>
       <td width="30" class="row1"><span class="row2">
        <input type="checkbox" name="email"  value="<bean:write name="user" property="email"/>" ></span></td>
       <td nowrap class="row1"><bean:write name="user" property="firstName"/>&nbsp;<bean:write name="user" property="lastName"/>&nbsp;&nbsp;</td>
       <td class="row1"><bean:write name="user" property="email"/>&nbsp;</td>
       <td class="row1"><bean:write name="user" property="userName"/>&nbsp;</td>
     </tr>
    </logic:iterate> </table>
</html:form>
</body>
</html:html>

解决方案 »

  1.   

    看document.agentdetails.AT.value行不行
      

  2.   

    function DoAction(Action,Index)
    {
         switch(Action)
         {
                case "Index":
                     document.agentdetails.AT.value = "Index";
                     document.agentdetails.index.value = Index;
                     document.agentdetails.submit();
                  break;
                case "Search":
                     var SearchSrting=document.forms[0].searchTopic.value;
                     if(SearchSrting.length==0)
                     return false;
                     document.agentdetails.AT.value = "Search";
                     document.agentdetails.searchTopic.value = SearchSrting;
                     document.agentdetails.submit();                 return true;
                    break;
         }}
      

  3.   

    修改DoAction方法,有没有错误?如果没有错误,你可以把
    <html:hidden name="ACDSelectAgentForm" property="AT"/>
    修改成显示,不要hidden,看看onclick="DoAction('Search','')以后AT显示的数值是不是你想要的
      

  4.   

    DoAction应该写的没有什么问题吧??
      

  5.   

    Parsing of JSP File '/webacd/jsp/preferences/agent_list.jsp' failed:
    --------------------------------------------------------------------------------
     /webacd/jsp/preferences/agent_list.jsp(56): The TLD description for tag 'write' requires that the body be empty.
    probably occurred due to an error in /webacd/jsp/preferences/agent_list.jsp line 56:
    <bean:write name="ACDSelectAgentForm" property = "AT"> 
    --------------------------------------------------------------------------------
    Mon Jul 12 14:03:36 CST 2004 
    报的错误
      

  6.   

    以下几句
    document.agentdetails.ACDSelectAgentForm.AT.value = "Index";
    document.agentdetails.ACDSelectAgentForm.index.value = Index;
    document.agentdetails.ACDSelectAgentForm.submit();
    中的ACDSelectAgentForm可能是错误的。
    那个位置的名称应该是iframe中<html:form action="/listagent">在客户端所生成的名称。