Empty value Check not validating on button click

Certified Senior Developer

Hello,

I am trying to do a simple check on a paragraphField or any field(integer, text, decimal field).

The validation is not working for empty or null. I tried giving a!isNullOrEmpty(ri!value), Null(ri!value), ri!value=null. The validation message is not shown. 

If i give any other logic, it works. 

  Discussion posts and replies are publicly visible

Parents Reply
  • +1
    Certified Senior Developer
    in reply to natashan0002

    Using a!validationMessage function will help to achieve this.

    a!formLayout(
      label: "New Application",
      contents: {
        a!paragraphField(
          label: "Paragraph",
          labelPosition: "ABOVE",
          value: ri!text,
          saveInto: { ri!text },
          refreshAfter: "UNFOCUS",
          height: "MEDIUM",
          validations: {}
        )
      },
      validations: a!validationMessage(
        message: "Invalid",
        showWhen: a!isNullOrEmpty(ri!text),
        validateAfter: "SUBMIT"
      ),
      buttons: a!buttonLayout(
        primaryButtons: {
          a!buttonWidget(
            label: "Submit",
            submit: true(),
            style: "PRIMARY"
          )
        }
      )
    )

Children