日期:2014-05-18  浏览次数:20881 次

我要实现用户联动,在选择部门的时候,刷新左边的区域,右边的区域不刷新,怎么做,我在线等待
<%@   page   contentType= "text/html;   charset=GBK "   %>
<%   request.setCharacterEncoding( "GBK ");   %>
<%@   page   import= "java.util.Iterator,
                                  java.sql.*,
                                  com.thinking.util.*,
                                  com.thinking.Exception.*,
  com.thinking.user.*,
                                    java.util.* "
%>
<jsp:useBean   id= "admin "   class= "com.thinking.user.admin "/>
<jsp:useBean   id= "member "   class= "com.thinking.user.DbMember "/>
<jsp:useBean   id= "dbdept "   scope= "page "   class= "com.thinking.user.DbDept "   />
<%
adminBean   adminbean=(adminBean)session.getAttribute( "loginAccount ");
if(adminbean==null   ||   adminbean.equals( "null ")){
      response.sendRedirect( "../user/login.jsp ");
}else{


%>
<html>
<head>
<title>
选择人员列表
</title>
</head>
<link   href= "../css/file.css "   type= "text/css "   rel= "stylesheet ">

<SCRIPT   language= 'javascript '>
function   move(s1,s2,flag){
var   tem=new   Array();
var   sa=document.form1.elements[s1];
var   sb=document.form1.elements[s2];
var   s=sa.selectedIndex> -1?1:0
with(sa)
for(i=length-1;i> =0;i--)
if(options[i].selected||flag){tem[tem.length]=options[i];options[i]=null}
if(s||flag)
{
for(i=0;i <sb.length;i++)   tem[tem.length]=sb.options[i]
with(sb)
{
length=0;
tem.sort(sortArr)
for(i=0;i <tem.length;i++)   options[length]=new   Option(tem[i].text,tem[i].value)
}
}
}

/*move_self(s,flag):s是列表框name,flag(1,-1),是上移或下移*/
function   move_self(s,flag)
{
var   sa=document.form1.elements[s]
var   tem;
with(sa)
{
if(flag==1)
{
if(selectedIndex> 0)
for(i=0;i <length;i++)
if(options[i].selected)
{
tem_text=options[i].text;tem_value=options[i].value;
options[i].text   =   options[i-1].text;
options[i].value   =   options[i-1].value;
options[i-1].text   =   tem_text;options[i-1].value   =   tem_value;
options[i-1].selected   =   true;options[i].selected   =   false;
}
}
else
{
for(i=length-1;i> =0;i--)
if(options[i].selected)
{
if(i==length-1)break;
tem_text=options[i].text;tem_value=options[i].value;
options[i].text   =   options[i+1].text;
options[i].value   =   options[i+1].value;
options[i+1].text   =   tem_text;options[i+1].value   =   tem_value;
options[i+1].selected