I want to give 2 different rule effects on the element. Let’s say in the following UI schema subCategory will be visible when the category length is more than 3 letters, once this condition is satisfied and subCategory is visible than I want to apply DISABLE effect on subCategory.
Hi @jharshita, thanks for your question! Currently you can only apply a single rule to each element. As a workaround you could wrap the control into VerticalLayout and apply the second rule to this element. Visually this should look the same.
But I’m having problems with nested structures, where 2 relevant elements don’t have same parent, like for example #/properties/firstContainer/properties/hasPromoCode and #/properties/secondContainer/properties/hasSomethingElse. I tried to get it working with
I’m not sure where this is coming from. We use the same AJV instance form-wide and there we disable strict mode. Do you hand in a custom AJV instance?
Note that your schema seems to be malformed as there is one "type": "object" too many. As "object" is not a valid schema for the property type maybe the error stems from that.
By removing strict: true , everything works as it should and some other weird schema-structure related errors are gone.
This is my final working solution:
When you create a custom AJV instance you might want to use createAjv exported from @jsonforms/core as it already sets the AJV options as we need them in JSON Forms. The method also takes in a parameter to set additional options if you need them.