Group-Level conditional visibility for fragment configuration fields

David H Nebinger, modificado hace 8 meses. New Member Mensajes: 7 Fecha de incorporación: 5/10/20 Mensajes recientes

Since Liferay DXP version 2025.Q2, it is now possible to configure "Conditional Field Visibility" in a fragment's configuration JSON: LPD-46393
https://liferay.atlassian.net/browse/LPD-46393
This new feature is very useful, as it helps avoid cluttering the configuration screen when fields are interdependent.
https://learn.liferay.com/web/guest/w/dxp/development/developing-page-fragments/reference/fragment-configuration-types-reference#conditional-field-visibility-configuration

However, there are still several drawbacks:

  • If x fields depend on the value of a single field, you have to configure each of those x fields individually by adding "dependency": { [...] } every time.

  • If a field’s visibility depends on another, both fields must be present in the same "fields" array.

What we would like is to be able to manage the visibility of a group of fields at the "fields" level — meaning the dependency property would be at the same level as "label", and not only inside each individual field.

Exemple :

{
	"fieldSets": [
		{
			"fields": [
			  {
				"name": "checkbox1",
				"type": "checkbox",				 
				...
              },
		      {
				"name": "checkbox2",
				"type": "checkbox",				 
				...
              }			  
			]	
        },		
		{
			"fields": [
			  { [...] },
			  { [...] },
			  { [...] },
			  { [...] }
			],
            "label": "Group 1",
            "dependency": {
				"checkbox1": {
					"type": "equal",
					"value": "true"
				}
            }			
        },		
		{
			"fields": [
			  { [...] },
			  { [...] },
			  { [...] },
			  { [...] }
			],
            "label": "Group 2",
            "dependency": {
				"checkbox2": {
					"type": "equal",
					"value": "true"
				}
            }			
        }
      ]
}

Is that something that could be done?

Kind regards,

Rita Schaff, modificado hace 8 meses. New Member Mensajes: 8 Fecha de incorporación: 18/02/20 Mensajes recientes

Hi Jérémy,

I've opened this feature request for you:

[LPD-62093] Group-Level conditional visibility for fragment configuration fields