小菜毛毛技術分享

          與大家共同成長

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            164 Posts :: 141 Stories :: 94 Comments :: 0 Trackbacks

          頁面:
          <script type='text/javascript' src='dwr/interface/timeLimitMVManager.js'></script>
          <script type='text/javascript' src='dwr/engine.js'></script>
          <script type='text/javascript' src='dwr/util.js'></script>
          <tr>
                   <th>
                       <fmt:message key="timelimitmv.tyep.name"/>
                   </th>
                   <td>
                    <select name="match_type_work_char_id" onchange="changeType(this)" id="match_type_work_char_id">
                                <option value=""><fmt:message key="msgtem.default" /></option>
                 <option value="1"><fmt:message key="timelimitmv.type1"/></option>
                 <option value="2"><fmt:message key="timelimitmv.type2"/></option>
                 <option value="4"><fmt:message key="timelimitmv.type4"/></option>
                       </select>

              
                   </td>
               </tr>
              
               <tr>
                   <th>
                       <fmt:message key="timelimitmv.value.name"/>
                   </th>
                   <td>
                    <select name="begin_value" id="begin_value">
                 <option value="1" ><fmt:message key="timelimitmv.type1"/></option>
                 <option value="2"><fmt:message key="timelimitmv.type2"/></option>
                 <option value="4"><fmt:message key="timelimitmv.type4"/></option>
                       </select>

              
                   </td>
               </tr>

          function changeType(sel_obj)
             {
               var match_type_work_char_id=sel_obj.value;
              
               if(match_type_work_char_id=='')
                  return;
               timeLimitMVManager.getVNByTN(match_type_work_char_id,showValue);
               
             }
            
             function showValue(dis)
             { 
            
            
               DWRUtil.removeAllOptions('begin_value');
               DWRUtil.addOptions('begin_value',dis,'begin_value','value_name');
             
             }
           dwr.xml:
           <allow>
                  <create creator="spring" javascript="timeLimitMVManager">
                     <param name="beanName" value="timeLimitMVManager"/>   --由SPRING進行管理的MANAGER名稱--
                     <include method="getVNByTN"/>  --暴露給頁面的方法--
                  </create> 
              </allow>

          manager方法:
          public List getVNByTN(String match_type_work_char_id) {
            // TODO Auto-generated method stub
            List obs=null;
            if(match_type_work_char_id!=null){
            if(match_type_work_char_id.equals("1")){
             obs=timeLimitMVDAO.getSBLXById();
            }
            if(match_type_work_char_id.equals("2")){
             obs=timeLimitMVDAO.getKUPPById();
            }
            if(match_type_work_char_id.equals("4")){
             obs=timeLimitMVDAO.getCXBZById();
            }
            }
            return obs;
           }
          posted on 2009-06-02 21:28 小菜毛毛 閱讀(1797) 評論(0)  編輯  收藏 所屬分類: AJAX
          主站蜘蛛池模板: 砚山县| 府谷县| 苏尼特左旗| 青冈县| 阜城县| 甘谷县| 获嘉县| 彰化市| 颍上县| 洛宁县| 扎囊县| 鞍山市| 保德县| 太谷县| 观塘区| 新乐市| 白水县| 德惠市| 裕民县| 隆德县| 纳雍县| 浏阳市| 绥芬河市| 河北省| 贵州省| 七台河市| 五家渠市| 从江县| 福安市| 札达县| 扎兰屯市| 汉源县| 凉山| 罗山县| 关岭| 图木舒克市| 南召县| 宜城市| 奇台县| 平山县| 鄯善县|