Beispiel #1
0
 protected void populateParams() {
   super.populateParams();
   UIBean uiBean = ((UIBean) component);
   S3TagValidationBuilder.build(
       this, this.getStack(), (HttpServletRequest) this.pageContext.getRequest(), uiBean);
   if (this.cssClass == null) {
     uiBean.setCssClass("form-control");
   }
   if (this.theme == null) {
     uiBean.setTheme("bootstrap3");
   }
 }
Beispiel #2
0
  protected void populateParams() {
    // 此段落必须放在super.populateParams()之前
    try {
      if (StringUtils.isNotBlank(autoValidate)) {
        this.setDynamicAttribute(null, "autoValidate", autoValidate);
      }
    } catch (JspException e) {
      e.printStackTrace();
    }

    super.populateParams();
    UIBean uiBean = ((UIBean) component);

    if (id == null) {
      String formid = "form_" + RandomStringUtils.randomAlphabetic(10);
      uiBean.setId(formid);
      // 将id属性设置到pageContext中,便于前端JS代码进行对象分组控制
      pageContext.setAttribute("closestFormId", formid);
    }
    if (this.theme == null) {
      uiBean.setTheme("bootstrap");
    }
  }