<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 59  文章 - 70  trackbacks - 0
    <2008年4月>
    303112345
    6789101112
    13141516171819
    20212223242526
    27282930123
    45678910

    常用鏈接

    留言簿(5)

    隨筆分類

    隨筆檔案

    搜索

    •  

    積分與排名

    • 積分 - 174145
    • 排名 - 340

    最新評論

    閱讀排行榜

    評論排行榜

    public ActionForward getOrganinfo_ajax(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) {
    String level2OrganId = request.getParameter( " level2OrganId " );
    System.out.print(level2OrganId);
    IDReportLogic dreportLogic = (IDReportLogic)SpringFactory.getBeanFactory().getBean( " dreportLogic " );

    response.setContentType( " text/xml;charset=UTF-8 " );
    response.setHeader( " Cache-control " , " no-cache " );

    try {

    String orgLevel = request.getParameter( " orgLevel " );
    String orgId = request.getParameter( " orgId " );



    /**/ /*
    以下為前臺當中接受到的xml結構。

    StringBuffer sb = new StringBuffer();
    sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
    String str="<select><kkk><value>11111</value><text>北京</text></kkk>";
    String str2="<kkk><value>3333</value><text>上海</text></kkk></select>";
    sb.append(str);
    sb.append(str2); */

    PrintWriter out = response.getWriter();
    out.write(str);
    out.flush();
    return null ;
    } catch (Exception e) {
    // TODO 自動生成 catch 塊
    request.setAttribute( " info " , " 獲取二級機構異常! " );
    e.printStackTrace();
    return mapping.getInputForward();
    }

    }





    二級機構:


    < select name = " secOrganIdSel " id = " secOrganIdSel "
    onchange = " selectChangeListener('2',this.options[this.selectedIndex].value); " >
    < option value = " -1 " > 請選擇機構.. </ option >
    </ select >

    三級機構:
    < select name = " thdOrganIdSel " id = " thdOrganIdSel "
    onchange = " selectChangeListener('3',this.options[this.selectedIndex].value); " >
    < option value = " -1 " > 請選擇機構.. </ option >

    </ select >

    四級機構:
    < select name = " forthOrganIdSel " >
    < option value = " -1 " > 請選擇機構.. </ option >
    </ select >

    < script language = " javascript " type = " text/javascript " >
    var xmlHttp;

    function createXMLHttpRequest() {
    if (window.ActiveXObject) {
    xmlHttp = new ActiveXObject( " Microsoft.XMLHTTP " );
    } else if (window.XMLHttpRequest) {
    xmlHttp = new XMLHttpRequest();
    }
    }

    // 查詢指定頁面
    function selectChangeListener(orgLevel,orgId) {

    createXMLHttpRequest();

    var url = " <%=request.getContextPath()%>/dreportAction.do?method=getOrganinfo_ajax&orgLevel= " + orgLevel + " &orgId= " + orgId;
    xmlHttp.open( " get " ,url, true );
    if (orgLevel == ' 2 ') {
    // 如果是選擇默認的第一個,則是清空后面3級機構和4級機構。
    var tempSel = document.getElementById( " secOrganIdSel " );
    if (tempSel.options[tempSel.selectedIndex].value == - 1 ) {
    var tempSel_1 = document.getElementById( " thdOrganIdSel " );
    tempSel_1.options.length = 1 ;
    var tempSel_2 = document.getElementById( " forthOrganIdSel " );
    tempSel_2.options.length = 1 ;
    return false ;
    }
    xmlHttp.onreadystatechange = callback2;
    } else if (orgLevel == ' 3 ') {
    // 如果三級機構默認的是第一個選項,則清空第4級機構

    var tempSel = document.getElementById( " thdOrganIdSel " );
    if (tempSel.options[tempSel.selectedIndex].value == - 1 ) {
    var tempSel_2 = document.getElementById( " forthOrganIdSel " );
    tempSel_2.options.length = 1 ;
    return false ;
    }
    xmlHttp.onreadystatechange = callback3;
    }

    xmlHttp.send( null );
    }

    // 返回信息處理,二級機構下拉列表返回結果
    function callback2() {
    if (xmlHttp.readyState == 4 ) {
    if (xmlHttp.status == 200 ) {
    var xmlDoc = xmlHttp.responseXML;
    changeSel(' 2 ',xmlDoc);
    } else {
    window.alert( " 您所請求的頁面有異常。 " );
    }
    }
    }


    // 返回信息處理,三級機構下拉列表返回結果
    function callback3() {
    if (xmlHttp.readyState == 4 ) {
    if (xmlHttp.status == 200 ) {
    var xmlDoc = xmlHttp.responseXML;
    changeSel(' 3 ',xmlDoc);
    } else {
    window.alert( " 您所請求的頁面有異常。 " );
    }
    }
    }

    // 更新機構下拉列表
    function changeSel(orgLevel,xmlDoc) {

    // var xsel = xmlDoc.getElementsByTagName('kkk');
    var xsel = xmlDoc.documentElement.childNodes;

    // alert(xsel.length);
    if (orgLevel == ' 2 ') {
    // 二級機構,3級機構和4級機構需要清空。
    var tempSel_1 = document.getElementById( " thdOrganIdSel " );
    tempSel_1.options.length = 0 ;
    tempSel_1.add( new Option('請選擇機構',' - 1 '))
    var tempSel_2 = document.getElementById( " forthOrganIdSel " );
    tempSel_2.options.length = 0 ;
    tempSel_2.add( new Option('請選擇機構',' - 1 '))

    for ( var i = 0 ; i < xsel.length;i ++ ) {
    var xvalue = xsel[i].childNodes[ 0 ].firstChild.nodeValue;
    var xtext = xsel[i].childNodes[ 1 ].firstChild.nodeValue;
    var option = new Option(xtext,xvalue);
    tempSel_1.add(option);
    }

    } else if (orgLevel == ' 3 ') {
    // 三級機構,四級機構需要清空

    var tempSel_2 = document.getElementById( " forthOrganIdSel " );
    tempSel_2.options.length = 0 ;
    tempSel_2.add( new Option('請選擇機構',' - 1 '))

    for ( var i = 0 ; i < xsel.length;i ++ ) {
    var xvalue = xsel[i].childNodes[ 0 ].firstChild.nodeValue;
    var xtext = xsel[i].childNodes[ 1 ].firstChild.nodeValue;
    var option = new Option(xtext,xvalue);
    tempSel_2.add(option);
    }

    }

    }
    </ script >
    posted on 2008-04-10 10:19 JasonChou 閱讀(815) 評論(0)  編輯  收藏 所屬分類: j2ee
    主站蜘蛛池模板: 久久久久亚洲爆乳少妇无| 最近中文字幕免费2019| 国产高清在线精品免费软件| 亚洲欧美成人av在线观看| 曰批全过程免费视频播放网站 | 亚洲精品成人图区| 免费一级不卡毛片| 8090在线观看免费观看| 亚洲国产高清在线| 日韩午夜理论免费TV影院| 亚洲视频在线视频| 中文字幕免费在线看线人| 亚洲一级高清在线中文字幕| 亚洲精品成a人在线观看☆| 好大好深好猛好爽视频免费| 亚洲成AV人片在线观看| 无码国产精品一区二区免费模式 | 四虎永久免费影院在线| 一级视频免费观看| 亚洲精品无码久久千人斩| 久久亚洲免费视频| 久久综合久久综合亚洲| 99久久免费国产精品热| 老司机亚洲精品影院无码 | 国产亚洲精品无码拍拍拍色欲| 岛国精品一区免费视频在线观看 | 亚洲成A人片在线播放器| 成在线人永久免费视频播放| h视频在线免费观看| 午夜电影免费观看| 成年网在线观看免费观看网址| 色窝窝免费一区二区三区| 亚洲日韩一区二区三区| 国产亚洲成归v人片在线观看| 99久久综合精品免费| 亚洲中文无码mv| 美女裸身网站免费看免费网站| 亚洲国产精品成人综合色在线| 亚洲熟妇av一区二区三区漫画 | 手机看片久久国产免费| 啦啦啦www免费视频|