Details
Description
I'm using:
<item id="9"> <c:ref>telephoneNumber</c:ref> <help>Mobile Telephone Number</help> <validation> <server> <expression> <trace>true</trace> <script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:ScriptExpressionEvaluatorType"> <code> import java.util.regex.Matcher import java.util.regex.Pattern import com.evolveum.midpoint.schema.result.OperationResult import com.evolveum.midpoint.schema.result.OperationResultStatus if (input == null) { return null } match = (input ==~ "^555-[0-9]{4}\$") if (match) { return null } result = new OperationResult("Validate telephone number"); result.setMessage("Telephone number must be 555-xxxx"); result.setStatus(OperationResultStatus.FATAL_ERROR) return result.createOperationResultType(); </code> </script> </expression> </server> </validation> </item>
The validation error is displayed at the top of the page, but not in the Telephone Number row. (As I remember it.)