Hide/Show (rules) property not working inside array nested level

Hide/Show (rules) property not working inside array nested level

Hi @prince_123_kumar,

Rules should work for nested arrays as they do for all other UI Schema elements. Note that you can’t hide/show/enable/disable array cells because we don’t even support defining rules for them in the UI Schema.

@sdirix Thanks Stefan for your reply. But i think it’s not working for me… Can you suggest me with a small example.
I am posting a small code here , i want to HIDE school_address (which is inside array nested level )on selection of MAK from student dropdown ( which is on top).

{
“type”: “object”,
“properties”: {
“abcd”: {
“type”: “string”,
“description”: “text”
},
“student”: {
“type”: “string”,
“enum”: [“Mak”, “Jonny”, “Michael”],
“default”: “Mak”,
“description”: “”
},
“sites”: {
“type”: “array”,
“minItems”: 1,
“items”: {
“type”: “object”,
“properties”: {
“school_name”: {
“type”: “string”,
“description”: “”
},
“address”: {
“type”: “array”,
“items”: {
“type”: “object”,
“properties”: {
“device_ip”: {
“type”: “string”,
“description”: “”
},
“current_address”: {
“type”: “object”,
“properties”: {
“school_address”: {
“type”: “string”,
“enum”: [“Text”],
“description”: “”
}
}
}
}
}
}
}
}
}
}
}

Hi @prince_123_kumar,

Sadly that is not possible with the off-the-shelf renderers at the moment. Currently we only allow to specify scoped UI Schemas for details like objects and arrays. So every scope within that detailed UI Schema can only be resolved within the address object.

We already had the discussion in issue #2094. It would be possible to add support for outside resolving in JSON Forms, it just needs to be implemented.

If you or someone else would like to make a contribution then you are very welcomed.

Note that if you implement custom renderers, then you can of course already support this today.