Uploaded image for project: 'MidPoint'
  1. MidPoint
  2. MID-6026

Form validation regression

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.0.2
    • 4.1, 4.0.3
    • GUI
    • Internal
    • v4.0.1-53-gb8177c4ad6

    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.)

      Attachments

        1. image-2020-01-29-15-36-42-385.png
          85 kB
          Ivan Noris
        2. screenshot-1.png
          7 kB
          Ivan Noris

        Activity

          People

            vix Ivan Noris
            vix Ivan Noris
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: