protected void verifyInput(ActionEvent arg0) throws Exception {
super.verifyInput(arg0);
//非空校验
HashMap<String, Object> verifyNullMap=new HashMap();
verifyNullMap.put("库存组织", prmtStorageOrgUnit);
verifyNullMap.put("工程类别", prmtProjectType);
verifyNullMap.put("设计量", txtDesignQty);
verifyNullMap.put("计量类型", comboMeasureType);
String [] strTmp=verifyNullMap.keySet().toArray(new String[verifyNullMap.size()]);
for(int i=verifyNullMap.size()-1;i>=0;i--)
CanNotNull(verifyNullMap.get(strTmp[i]),strTmp[i]);
//非0校验 可为空
HashMap<String, Object> verifyZeroMap=new HashMap();
verifyZeroMap.put("设计量", txtDesignQty);
String [] strZeroTmp=verifyZeroMap.keySet().toArray(new String[verifyZeroMap.size()]);
for(int i=verifyZeroMap.size()-1;i>=0;i--)
CanNotZero(verifyZeroMap.get(strZeroTmp[i]),strZeroTmp[i]);
}
//非空校验函数
protected void CanNotNull(Object obj,String message)
{
if((obj instanceof KDBizPromptBox && ((KDBizPromptBox)obj).getValue()==null)||
(obj instanceof KDComboBox && ((KDComboBox)obj).getSelectedItem()==null )||
(obj instanceof KDFormattedTextField &&((KDFormattedTextField)obj).getValue()==null))
{
MsgBox.showInfo(message+"不能为空!");
((JComponent)obj).requestFocus();
abort();
}
}
//非0校验函数 可为空
protected void CanNotZero(Object obj,String message)
{
if(obj instanceof KDFormattedTextField && ((KDFormattedTextField)obj).getValue()!=null &&
(((KDFormattedTextField)obj).getBigDecimalValue().compareTo(BigDecimal.ZERO)==0))
{
MsgBox.showInfo(message+"值不能为 '0' !");
((JComponent)obj).requestFocus();
abort();
}
}
BOS中控件非空 非0校验
原创
©著作权归作者所有:来自51CTO博客作者fyq891014的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:BOS新建连接属性
下一篇:BOS中获取编码规则
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Java使用JsonNode判断实体类非空
使用jsonNode去判断实体类的参数是否为空
jsonnode java hutool -
实现java参数非必传
1、路径参数:@PathVariable(required = false)实现参数aaa非必传2、非路径参数:@RequestParam(required = false) 实现参数aaa非必传3、实体参数:@RequestBody(required = false)实现实体aaa非必传
参数 required @PathVariable @RequestParam @RequestBody -
jQuery 校验非空 前端非空校验
form表单确定按钮js部分确定按钮的方法
jQuery 校验非空 vue单页面提交非空校验 form表单 -
spring validate Integer 怎么校验非空 spring非空注解
spring常见注解:标注类上的注解:@Data : 标注在类上,提供类的get、set、equals、hashCode、canEqua
spring java mybatis 打印日志 配置文件