Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Validations are not called when I use section in Dyanmic Form.

    Hi Iso,

    Below is the field declaration of section.

    {
    name:"bi",
    defaultValue: "Basic Information",
    type: "section",
    showIf :"this.form != null",
    sectionExpanded: false,
    itemIds: [
    "code","name"
    ]}

    Both items included in this section are required fields and when I don't include them in section I can see validation errors/ required field errors but when section is collapsed and I click on save, the form is submitted without validation being checked for these fields and I get back end error for PK.

    I need to perform validation even if section is closed/ collapsed and if there are errors then section should open on click of save with errors showing up and form not being submitted.

    Is my requirement valid?

    Thanks.

    #2
    You can force validation of hidden fields. See DynamicForm.validate().

    Comment


      #3
      But are these fields set as hidden when section is collapsed. I didn't define them as hidden.

      Thanks,
      Karan.

      Comment


        #4
        Yeah. Same solution.

        Comment


          #5
          Thanks ISO,

          You did a quick fix.

          Comment


            #6
            I got into a problem.

            I have databound fields which are not validated and in reference docs I found that handleHiddenValidationErrors(error) is the function to do that. But can anyone tell me how and where to use this function.

            Thanks,
            Karan.

            Comment

            Working...
            X