Ask - Test
Group-Level conditional visibility for fragment configuration fields
Group-Level conditional visibility for fragment configuration fields
New Member Posts: 6 Join Date: 10/5/20 Recent PostsSince 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,
RE: Group-Level conditional visibility for fragment configuration fields
New Member Posts: 8 Join Date: 2/18/20 Recent PostsHi Jérémy,
I've opened this feature request for you:
[LPD-62093] Group-Level conditional visibility for fragment configuration fields
Powered by Liferay™