コード例 #1
0
 /**
  * AJAX 示例下拉框
  *
  * @param req
  * @return
  */
 @RequestMapping(params = "getDemo")
 @ResponseBody
 public AjaxJson getDemo(HttpServletRequest req) {
   AjaxJson j = new AjaxJson();
   String id = StringUtil.getEncodePra(req.getParameter("id"));
   String floor = "";
   if (StringUtil.isNotEmpty(id)) {
     if ("ThreeLevelLinkage".equals(id)) {
       floor += "省:<select name=\"province\" id=\"provinceid\">" + "</select>" + "&nbsp;&nbsp;";
       floor += "市:<select name=\"city\" id=\"cityid\">" + "</select>" + "&nbsp;&nbsp;";
       floor += "县:<select name=\"county\" id=\"countyid\">" + "</select>" + "&nbsp;&nbsp;";
     } else {
       CriteriaQuery cq = new CriteriaQuery(TSFunction.class);
       cq.eq("TSFunction.id", id);
       cq.add();
       List<TSFunction> functions = systemService.getListByCriteriaQuery(cq, false);
       if (functions.size() > 0) {
         for (TSFunction function : functions) {
           floor +=
               "<input type=\"checkbox\"  name=\"floornum\" id=\"floornum\" value=\""
                   + function.getId()
                   + "\">"
                   + MutiLangUtil.getMutiLangInstance().getLang(function.getFunctionName())
                   + "&nbsp;&nbsp;";
         }
       } else {
         floor += "没有子项目!";
       }
     }
   }
   j.setMsg(floor);
   return j;
 }
コード例 #2
0
  public int doEndTag() throws JspTagException {
    title = MutiLangUtil.doMutiLang(title, langArg);

    Tag t = findAncestorWithClass(this, DataGridTag.class);
    DataGridTag parent = (DataGridTag) t;
    parent.setToolbar(url, title, icon, exp, onclick, funname, operationCode, width, height);
    return EVAL_PAGE;
  }