DropdownField with validationGroup but want to validate null value

Hi,

I have a dropdownField case with two buttons:

a!dropdownField(
            label: "Field",
            labelPosition: "ADJACENT",
            placeholderLabel: "--- Select a Value ---",
            choiceLabels: {1,2,3,4},
            choiceValues: {1,2,3,4},
            validationGroup: "Submit",
            validations: {"some warning message"},
            saveInto: ri!test,
            value: ri!test,
            required: true
          )

One button is "Submit", with validationgroup when I did not the select an value, it will have required message.

Another button is "Publish", which was not bundled the validationGroup, if I did not select one, and left it as null, and click Submit button directly, the required message did not come out, but I still need this null validation.

Anyone know how to handle my case? Thanks.

  Discussion posts and replies are publicly visible

Parents
  • load(
      local!test,
      a!formLayout(
        label: "Example: ",
        contents: {
          a!dropdownField(
            label: "Field",
            labelPosition: "ADJACENT",
            placeholderLabel: "--- Select a Value ---",
            choiceLabels: {
              1,
              2,
              3,
              4
            },
            choiceValues: {
              1,
              2,
              3,
              4
            },
            validationGroup: "Submit",
            requiredMessage: "some warning message",
            saveInto: local!test,
            value: local!test,
            required: true
          )
        },
        buttons: a!buttonLayout(
          primaryButtons: {
            a!buttonWidget(
              label: "Publish",
              submit: true
            ),
            a!buttonWidget(
              label: "Submit",
              style: "PRIMARY",
              submit: true,
              validationGroup: "Submit"
            )
          }
        )
      )
    )

Reply
  • load(
      local!test,
      a!formLayout(
        label: "Example: ",
        contents: {
          a!dropdownField(
            label: "Field",
            labelPosition: "ADJACENT",
            placeholderLabel: "--- Select a Value ---",
            choiceLabels: {
              1,
              2,
              3,
              4
            },
            choiceValues: {
              1,
              2,
              3,
              4
            },
            validationGroup: "Submit",
            requiredMessage: "some warning message",
            saveInto: local!test,
            value: local!test,
            required: true
          )
        },
        buttons: a!buttonLayout(
          primaryButtons: {
            a!buttonWidget(
              label: "Publish",
              submit: true
            ),
            a!buttonWidget(
              label: "Submit",
              style: "PRIMARY",
              submit: true,
              validationGroup: "Submit"
            )
          }
        )
      )
    )

Children