I am trying to add either an icon or an image control, based on a separate choose control.
However, I cannot seem to get the “when” condition to work. When the when condition below is written, both the icon and image controls disappear.
{
“size” : {
“label” : “Size”,
“type” : “font-size”,
“initial” : “1em”,
“isVar” : true
},
“awards” : {
“type” : “group[]”,
“label” : “Awards”,
“itemLabel” : “{{index}}. {{awardName}}”,
“params” : {
“graphictype” : {
“type” : “choose”,
“label” : “Type”,
“options” : [
{“value” : “image”, “label” : “Image”},
{“value” : “icon”, “label” : “Icon”}
]
},
“graphicicon” : {
“type” : “fa-icon”,
“label” : “Icon”,
“initial” : “award”,
“when” : “eq(graphictype, ‘icon’)”
},
“graphicimg” : {
“type” : “image”,
“label” : “Image”,
“initial” : “”,
“when” : “eq(graphictype, ‘image’)”
},
“awardName” : {
“type” : “textarea”,
“label” : “Award Name”,
“placeholder” : “Best Restaurant Ever”
},
“source” : {
“type” : “source”,
“label” : “Source”,
“placeholder” : “Google”
},
“url” : {
“type” : “text”,
“label” : “URL”,
“placeholder” : “https://www.google.com/review”
}
}
}
}
Where am I going wrong?
