小菜毛毛技术分享

与大家共同成长

  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 小菜毛毛 阅读(1781) 评论(0)  编辑  收藏 所属分类: AJAX

只有注册用户登录后才能发表评论。


网站导航: