I have the scenario like when i get the respective value from the drop down other field should have to disable …
eg. Drop down value contains a,b,c .When user select the value C my textbox should have to disable… I have to tried to set the Rule in the Layout schema … But the Rule not applied successfully … Drop Down we are keeping custom Component…
Above code for checkbox …When i change the dropdown value that check box should have to checked …When i change the other value in dropDown it should have to unchecked
Scenario 2: when i changed the dropdown value the checkbox should have to change Normal TextBox …When i change the another dropDown value checkbox should change to Dropdown,How to acheive this?
you can take is example Rule | JSON Forms 1. When i select a Zombie Is Dead check box should have unchecked .When i select Vampire Is Dead Check box should have to check
Above code for checkbox …When i change the dropdown value that check box should have to checked …When i change the other value in dropDown it should have to unchecked
Scenario 2: when i changed the dropdown value the checkbox should have to change Normal TextBox …When i change the another dropDown value checkbox should change to Dropdown,How to acheive this?
You can “fake” this via rule support by hiding and showing different text and boolean controls. Visually it will look like the control changed but actually they are two different controls. However you will have two different data entries then.
If you’re fine with combinators you can solve this in a clean way via oneOfs instead of via rules. However instead of a drop down JSON Forms will render it as tabs.
If that’s not an option then you need either:
use a custom renderer which renders a string/boolean depending on the enum value, or
exchange schema and data on enum change to replace the string value with a boolean or vice versa
I see, I wasn’t aware that you’re using the Angular renderers. They don’t yet support the oneOf constructs. In that case you will have to add a custom renderer which can handle your special use case. Still I would probably model this as a oneOf.