It is possible to create a dynamic lists in portlet configuration

Jamie Sammons, modified 1 Year ago. New Member Posts: 2 Join Date: 3/28/24 Recent Posts

I created a react portlet via liferay-npm-bundler, deployed in Liferay 7.3.5 -> working

Now I created a configuration.json file in features localization, then deployed -> working:

{
  "system": {
    "category": "third-party",
    "name": "SAMPLE CONFIG",
    "fields": {
      "a-number": {
        "type": "number",
        "name": "A number",
        "description": "An integer number",
        "default": "42"
      },
      "a-string": {
        "type": "string",
        "name": "A string",
        "description": "An arbitrary length string",
        "default": "this is a string"
      },
      "a-password": {
        "type": "password",
        "name": "A password",
        "description": "A secret string",
        "default": "s3.cr3t"
      },
      "a-boolean": {
        "type": "boolean",
        "name": "A boolean",
        "description": "A true|false value",
        "default": true
      },
      "an-option": {
        "type": "string",
        "name": "An option",
        "description": "A restricted values option",
        "required": true,
        "default": "A",
        "options": {
          "A": "Option a",
          "B": "Option b"
        }
      }
    }
  },
  "portletInstance": {
    "name": "Widget configuration",
    "fields": {
      "a-float": {
        "type": "float",
        "name": "A float",
        "description": "A floating point number",
        "default": "1.1"
      }
    }
  }
}

But I have a question is it possible to create a dynamic more complex list in this configurations, like I have a SELECT1 field -> I grab values from API -> Then I have a SELECT2 field that API call rely on choosed value from SELECT1?

If no, how is the best way to do it

I will be grateful for your answers