Uploaded image for project: 'Talend Component Kit'
  1. Talend Component Kit
  2. TCOMP-2379

Validations on parent attributes are check even if the object is ActiveIf==false when value is null

Apply templateInsert Lucidchart Diagram
    XMLWordPrintable

Details

    Description

      I have a configuration:

      class MyConfig {
          @Option
          private boolean checkbox;
      
          @Option
          @ActiveIf(target = "checkbox", value = "true")
          @Required
          private String firstField = null;
          
          @Option
          @ActiveIf(target = "checkbox", value = "false")
          @Required
          private String secondField = null;
      }
      

      Expected:
      when checkbox = true, firstField is required, and seconField is not required.
      Actual
      when checkbox = true, firstField is required, and seconField is required too (I see validation error on Cloud).
      Can't reproduce the same behavior with talend-component:web,
      Also. Note. When initializing firstField and secondField with init value, it can be an empty string, the actual behavior becomes an expected behavior.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ozhelezniak Oleksandr Zhelezniak
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: