Validation not refreshing when navigating interfaces

Hello All,

I have an issue wherein my validationMessage is not removing after clicking cancel button. My scenario is I have a User Form that whenever I click submit it will show a message "All fields are required". After that I will now click the Cancel Button. However, when I go back to the Form my validation is still there. Can anyone explain to me how can I prevent that from happening?

Here's my validation

a!validationMessage(
message: "You must fill up both roles and email address!",
validateAfter: "SUBMIT",
showWhen: or(isnull(local!email), isnull(local!role))
)

Here's my field

a!textField(
label: "Email",
labelPosition: "ABOVE",
value: local!email,
saveInto: local!email,
refreshAfter: "UNFOCUS",
validations: {}
)

I put the validationMessage under the columnLayout.

  Discussion posts and replies are publicly visible

Parents
  • If you are not submitting the form on cancel button, then you can try this

    a!localVariables(
      local!amount,
      local!buttonValue,
      local!showWhen:and(local!buttonValue,isnull(local!amount)),
      a!formLayout(
        contents: {
          a!textField(
            label: "Amount",
            value: local!amount,
            saveInto: local!amount
          )
        },
        buttons: {
          a!buttonArrayLayout(
            buttons: {
              a!buttonWidget(
                label: "Submit",
                style: "PRIMARY",
                submit: true,
                saveInto: {
                  a!save(local!buttonValue,true)
                }
              ),
              a!buttonWidget(
                label: "cancel",
                saveInto: {
                  a!save(local!buttonValue,false)
                }
              )
            }
          )
        },
        validations: a!validationMessage(
          message: "Is required",
          validateAfter: "SUBMIT",
          showWhen: local!showWhen
        )
      )
    )

  • Hello, Thank you for your response. However, I already tried it changing the showWhen value to false when I click cancel. However, when I go back to userRegistration form the validation will be removed. But when I add ri!ShowWhen then change it back to true after clicking the "Create User" button the validation is still there.

Reply Children