Conditional loading of fields in template UI for Radio button
See original GitHub issueHi, I need to load the below react json schema component (conditional field) in template UI:
{
"title": "Schema dependencies",
"description": "These samples are best viewed without live validation.",
"type": "object",
"properties": {
"conditional": {
"title": "Conditional",
"$ref": "#/definitions/person"
}
},
"definitions": {
"person": {
"title": "Person",
"type": "object",
"properties": {
"Do you have any pets?": {
"type": "string",
"enum": [
"No",
"Yes: One",
"Yes: More than one"
],
"default": "No"
}
},
"required": [
"Do you have any pets?"
],
"dependencies": {
"Do you have any pets?": {
"oneOf": [
{
"properties": {
"Do you have any pets?": {
"enum": [
"No"
]
}
}
},
{
"properties": {
"Do you have any pets?": {
"enum": [
"Yes: One"
]
},
"How old is your pet?": {
"type": "number"
}
},
"required": [
"How old is your pet?"
]
},
{
"properties": {
"Do you have any pets?": {
"enum": [
"Yes: More than one"
]
},
"Do you want to get rid of any?": {
"type": "boolean"
}
},
"required": [
"Do you want to get rid of any?"
]
}
]
}
}
}
}
}
Any suggestions on how to convert this to template.yaml file?
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Exposing Additional Form Fields via Checked Radio Buttons
Weird Quirk. Becca Rice wrote in to tell me that there is a bug with the CSS stuff that reveals the additional fields...
Read more >DocuSign Radio button conditional field - Stack Overflow
The DocuSign documentation says "You can apply conditional logic to the following field types:Checkbox, Radio Button, Drop-down,Text".
Read more >Is it possibile to show fields based on radio button selections?
I trying to make a radio button panel, that have 2 options, ... Conditional Logic: Is it possibile to show fields based on...
Read more >Radio Buttons Fieldtype — ExpressionEngine 6 Documentation
Radio Buttons allow users to choose a single item from a list of options. ... The short name of a field is used...
Read more >Radio button requires two clicks to "check" even though ...
I am working on a component that has a simple 2 option radio group. I want to show and hide a div (template...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @defaultbr. I got this one working for the dropdown (select) on the UI. I was looking for Radio button option hence tried adding ui:widget: radio to the yaml. In React Json Schema form it renders as radio button with dependencies however when converted to YAML it does not work. Radio button along with $ref dependencies does not render when added in YAML format
@sharadpattanshetti you could test this example
What I have learned testing the above yml code:
Segregate the template in more software catalog, don’t try to merge multiple languages and things to consider in one file, this will make your template a big, very very big and confuse spaghetti.
dependency are coupled in the field title/name, so try to use simple names
You can’t import (use the $include) external files, so you will return to item 1 above if you plan to consolidate a lot of questions and if’s inside a single template file
Maybe a good use will be to create a catalog entry for Libraries, another for API’s, etc…
If you create a Api and can have deploy in multiple targets, like in kubernetes, azure, aws, gcp, I guess it’s better to have different catalog entry for each one, since you can ask a lot of different things for each option and your template will be hard to read.
Examples:
(of course, if each one has different requirements and fields)
Maybe I’m totally wrong, since I learned this almost 30 minutes ago, if i find a way to consolidate and avoid a huge spaguetti, I will post here again