• Hadrien Ledanseur
        Has successfully completed the online course Basics (100)
      1 year ago #35419

      Hello,

      It is not quite clear how to use validation on an input field in simplifier.

      For instance, let’s say I have an input field of type email and add some pattern (regex) to validate the email and I want to do this validation on a click of a button to check if we can go on to a next step.

      Then in the process designer, how would I go about implementing that?

      Vitali Kurdasov
          Has successfully completed the online course Intermediate (200)
          Has successfully completed the online course Basics (100)
          Has successfully completed the online course Advanced (310)
          Has successfully completed the Intermediate Certification
        1 year ago #35435
        Up
        1
        Down
        ::

        Hi Hadrien,

        i would suggest you two possible options.

        1. If you use a SimpleForm

        Go to Domaintypevalidation on your desired input field

        Afterwards select the domaintype Email, activate the eventswitch and change the event to validateFieldGroup, as last step set the property required of your input to true.

        Now switch to the ProcessDesigner and use the ClientsideBusinessObject SF_Validate with the method validateSimpleForm.

        If you can’t find this BusinessObject download the newest Version of StandardContent for your Simplifier version.

        As inputparameter use formId where you write the id of your SimpleForm. Now you can use the green and red dot as on conditions. (Notice that every element in your SimpleForm will be checked if it is required!)

        2. If you don’t use SimpleForms

        Configure the domaintype validation the same, but change the event wo change

        Afterwards go to the ProccessDesigner and configure the conditionshape as following

        I hope this helps you to solve you Problem!

        Alex K
            Has successfully completed the online course Intermediate (200)
            Has successfully completed the online course Advanced (300)
            Has successfully completed the online course Basics (100)
            Has successfully completed the online course Advanced (310)
            Has successfully completed the online course Advanced (320)
          1 year ago #35432
          Up
          0
          Down
          ::

          For regex, you need to Subscribe to the button event. Then execute a custom script, getting the contents of the textfield.

          Either by
          var element = sap.ui.getCore("Application").byId("MY UIELEMENT ID").getValue();

          or by getting the binded variableHolder via:

          var element = this.getGlobals().getVar("MY VARIABLEHOLDER").getValue();

          then inserting the data into a regex Javascript. Examples:
          https://www.w3schools.com/jsref/jsref_obj_regexp.asp

          Further you have 2 ways of designing the display of an error message:
          Either Toast-Message and Red Border on Elements

          or:
          Assigning a new Variable with an error or success-message and putting that variable in an UI-Event.

          Hadrien Ledanseur
              Has successfully completed the online course Basics (100)
            1 year ago #35436
            Up
            0
            Down
            ::

            Thank you for the comprehensive information.

          Viewing 4 posts - 1 through 4 (of 4 total)

          You must be logged in to reply to this topic.