IDEMPIERE-6096 Implement regexp VFormat - improve message (#2306)
This commit is contained in:
parent
4ac98a630a
commit
0d0c33d197
|
@ -221,8 +221,10 @@ public class WStringEditor extends WEditor implements ContextMenuListener
|
||||||
// Validate VFormat with regular expression
|
// Validate VFormat with regular expression
|
||||||
if (!Util.isEmpty(vFormat) && vFormat.startsWith("~")) {
|
if (!Util.isEmpty(vFormat) && vFormat.startsWith("~")) {
|
||||||
String regex = gridField.getVFormat().substring(1); // remove the initial ~
|
String regex = gridField.getVFormat().substring(1); // remove the initial ~
|
||||||
if (!newValue.matches(regex))
|
if (!newValue.matches(regex)) {
|
||||||
throw new WrongValueException(component, Msg.getMsg(Env.getCtx(), "InvalidFormatRegExp", new Object[] {regex}));
|
String msgregex = Msg.getMsg(Env.getCtx(), regex);
|
||||||
|
throw new WrongValueException(component, Msg.getMsg(Env.getCtx(), "InvalidFormatRegExp", new Object[] {msgregex}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
ValueChangeEvent changeEvent = new ValueChangeEvent(this, this.getColumnName(), oldValue, newValue);
|
||||||
|
|
Loading…
Reference in New Issue