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

New @Hidden annotation for @Properties

Apply templateInsert Lucidchart DiagramXMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Major Major
    • 1.65.0, 1.65.0M7
    • None
    • ui
    • All
    • GreenHopper Ranking:
      0|i27sx7:
    • 9223372036854775807
    • Small

      TCK let us create extensions.
      In extension, we can update repository model that is very useful.

      But there is a lake : the extension can update the model, but it can't influence the values set in the configuration class at runtime.

       
      For instance, let's take an option:

      @Option
      @Required
      @Documentation("Data base type from the supported data base list.")
      @Proposable(ACTION_LIST_SUPPORTED_DB)
      private String dbType;

      With extension, I'm able to dynamically transform it to:

      @Option
      @Required
      @Documentation("Data base type from the supported data base list.")
      @Default("Mysql")
      private String dbType;

      So in form, the user will see a text field with a default value.

      But what is f I want to not display this field and enforce its value to "Mysql" ?

      I can try with an @activeIf

      @Option
      @Required
      @Documentation("Data base type from the supported data base list.")
      @Default("Mysql")
      @ActiveIf(target = ".", value = "_IMPROBABLE_VALUE_TO_HIDE_THIS_FIELD_")
      private String dbType;

      The field is hidden, but, the @Default is taken into account only if the field is visible.

      So the dbType attribute will always be null at runtime.

      Want I would want to do is :

      @Option
      @Required
      @Documentation("Data base type from the supported data base list.")
      @Default("Mysql")
      @Hidden
      private String dbType;

      And the integration would set the @default value in the field even if it is hidden.

      With this, extension can automagically complete configuration, which would be great.

       

      [EDIT]

      Could be also very useful in some other cases like this one : https://jira.talendforge.org/browse/TDI-46122

      We want an explicitly hidden field and the only current way is the workaround, which consists of define an always false @ActiveIf

            acatoire Axel Catoire
            ypiel Yves Piel
            Axel Catoire, Yueyan Yin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: