I have List with Detail control (List With Detail Example - JSON Forms), Here is the schema json
{
"type": "object",
"properties": {
"fee": {
"properties": {
"offers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"paymentType": {
"type": "string",
"enum": [
"Advance",
"On the fly"
]
},
"security": {
"type": "string",
"enum": [
"Debt",
"Equity",
"Certificates",
"Other"
]
},
"shares": {
"type": "number",
"decimalPattern": {
"pattern": "^\\d{0,12}$",
},
}
},
"required": [
"paymentType",
"security"
]
}
},
"totalFee": {
"properties": {
"amountFees": {
"type": "number",
"decimalPattern": {
"pattern": "^\\d{0,14}(\\.\\d{0,2})?$",
},
}
}
}
}
}
}
}
Here is the Ui schema
{
"type": "Category",
"elements": [
{
"type": "VerticalLayout",
"elements": [
{
"type": "ListWithDetail",
"scope": "#/properties/fee/properties/offers",
"options": {
"labelRef": "security",
"detail": {
"type": "HorizontalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/paymentType",
"options": {
"variant": "dropdown"
}
},
{
"type": "Control",
"scope": "#/properties/security",
"options": {
"variant": "dropdown"
}
},
{
"type": "Control",
"scope": "#/properties/shares",
"label": "Amount Being Registered",
"rule": {
"effect": "DISABLE",
"condition": {
"scope": "#/properties/paymentType",
"schema": {
"enum": [
"On the fly"
]
}
}
}
}
]
}
}
},
{
"type": "Control",
"scope": "#/properties/fee/properties/totalFee/properties/amountFees",
"rule": {
"effect": "DISABLE",
"condition": {
"scope": "#/properties/paymentType",
"schema": {
"enum": [
"On the fly"
]
}
}
}
}
]
}
]
}
The condition is when the user selects paymentType as “on the fly” in the array the field
#/properties/fee/properties/totalFee/properties/amountFees, should be disabled. but when the user selects paymentType as “Advance”, the amountFees input field should be enabled, the amountFees is not part of ListWithDetail but separate input control. How can i achieve that?