Aras 修改正则表达式验证时,错误的提示信息1 添加 List 名称为 StringFormat 用于管理 String 类型中用到的所有的判断正则表达式 如下 2 添加方法 StringPatter 用于在 Property 中 属性为 String 时 Pattern 将 List StringFomat 加载并显示为下拉框选择 代码如下 varfield grid columns Experimental get colNu
1、添加List(名称为StringFormat),用于管理String类型中用到的所有的判断正则表达式。如下:
2、添加方法(StringPattern),用于在Property中,属性为String时,Pattern将List(StringFomat)加载并显示为下拉框选择。代码如下:
var field = grid[‘columns_Experimental’].get(colNumber, ‘name’);
if (getRelationshipProperty(relationshipID, ‘data_type’) != ‘string’) {
grid[‘columns_Experimental’].set(field, ‘editType’, undefined);
return true;
}
4、修改服务器文件aras_object.js(路径: 安装目录\Innovator\Innovator\Client\javascript\),修改方法Aras_isPropertyValueValid case 为String时的处理方式,修改为如下代码:
case ‘string’:
if (propertyDef.stored_length < propertyValue.length) {
this.ValidationMsg = this.getResource(”, ‘aras_object.length_properties_value_canot_be_larger’, propertyDef.stored_length);
break;
}
if (data_type == ‘string’ && propertyDef.pattern) {
var re = new RegExp(propertyDef.pattern);
if (!re.test(propertyValue)) {
var inno=aras.newIOMInnovator();
var itm=inno.newItem(‘Value’,’get’);
itm.setProperty(‘value’,propertyDef.pattern);
itm=itm.apply();
if(!itm.isError() && !itm.isEmpty())
{
var msg=itm.getItemByIndex(0).getProperty(‘label’);
this.ValidationMsg = this.getResource(”, ‘aras_object.value_property_invalid_must_correspond_with_pattern’, msg);
}
//this.ValidationMsg = this.getResource(”, ‘aras_object.value_property_invalid_must_correspond_with_pattern’, propertyDef.pattern);
break;
}
}
break;
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/219802.html原文链接:https://javaforall.net