<form id="form" name="form" method="post" action="/sf_js_api/tag/toSelect.do" onsubmit="return false;"> <div sf_type="SF_CheckBoxGroup" id="SF_USERS" length="8" textField="LNAME" valueField="ID"></div> <input type="button" value="确定" onclick="M_Sf_js_api.getSelectInfo();" /> </form> M_Sf_js_api.getSelectInfo = function() { var str = ""; $("input:checkbox:checked").each(function(){ //获取id和名称的凭借字符 格式为 id:name,id1:name1 var text = $(this).val()+":"+$(this).next().text(); str += text+"," ; }); if(!SF_DataConvert.isNullOrEmpty(str)){ str = str.substring(0, str.length); } parent.$("#sf_ds_user").attr("data",str); parent.$.XYTipsWindow.removeBox(); //关闭弹窗 };
@RequestMapping("toSelect.do") public ModelAndView toSelect(HttpServletRequest request,HttpServletResponse response, ModelMap modelMap) { FormSource source = this.source(request); TagService service = this.createService(); try { List<?> list = service.beans(new SF_USERS());//查询所有用户信息 source.add("SF_USERS",list); source.put(modelMap); } catch (Exception e) { this.logger.error(e); } return new ModelAndView( this.getActionPath("detailselector_select"), modelMap ); }