From 0d0c33d197c6a4c3b6b9d43cbb0d59bbff5062dc Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 9 Apr 2024 16:16:57 +0200 Subject: [PATCH] IDEMPIERE-6096 Implement regexp VFormat - improve message (#2306) --- .../src/org/adempiere/webui/editor/WStringEditor.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java index c8f382cf4c..5ea73f089a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java @@ -221,8 +221,10 @@ public class WStringEditor extends WEditor implements ContextMenuListener // Validate VFormat with regular expression if (!Util.isEmpty(vFormat) && vFormat.startsWith("~")) { String regex = gridField.getVFormat().substring(1); // remove the initial ~ - if (!newValue.matches(regex)) - throw new WrongValueException(component, Msg.getMsg(Env.getCtx(), "InvalidFormatRegExp", new Object[] {regex})); + if (!newValue.matches(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);