下拉选校验
在线表单,如果控件是下拉选,校验规则里怎么设置它是必填项,求指导!现在设置了datatype="*"或者datatype="select1"都不起作用! datatype="*" 刚才看了下生成代码的源程序,发现DictSelectTag类的end()方法,针对select没有加入datatype的处理,代码如下:
sb.append("<select name=\"" + field + "\"");
//update-begin--Author:jg_xugj许国杰Date:20151209 for:#775 增加只读属性
this.readonly(sb);
//update-end--Author:jg_xugj 许国杰Date:20151209 for:#775 增加只读属性
//增加扩展属性
if (!StringUtils.isBlank(this.extendJson)) {
Gson gson = new Gson();
Map<String, String> mp = gson.fromJson(extendJson, Map.class);
for(Map.Entry<String, String> entry: mp.entrySet()) {
sb.append(entry.getKey()+"=\"" + entry.getValue() + "\"");
}
}
if (!StringUtils.isBlank(this.id)) {
sb.append(" id=\"" + id + "\"");
}
sb.append(">");
//update-begin--Author:zhangdaihaoDate:20140724 for:默认选择项目--------------------
select("common.please.select", "", sb);
//update-end--Author:zhangdaihaoDate:20140724 for:默认选择项目----------------------
for (Map<String, Object> map : list) {
select(map.get("text").toString(), map.get("field").toString(), sb);
}
sb.append("</select>");
页:
[1]