小菜毛毛技術分享

          與大家共同成長

            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
          主站蜘蛛池模板: 武功县| 东乡县| 榆树市| 大关县| 江孜县| 新兴县| 吕梁市| 涪陵区| 清流县| 双桥区| 渭源县| 安岳县| 澄城县| 务川| 来安县| 新宁县| 柘荣县| 平江县| 郓城县| 恩施市| 阜宁县| 弥渡县| 信丰县| 泽州县| 墨玉县| 股票| 黄陵县| 普洱| 胶州市| 武强县| 志丹县| 大石桥市| 财经| 莱西市| 吐鲁番市| 遂川县| 沈丘县| 科技| 大渡口区| 诏安县| 清水县|