If I am making the checkbox default checked, on some existing pages checkbox is not showing checked
If I am making the checkbox default checked using coral2 checkbox field,
<enableBanner
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/checkbox"
fieldDescription="Check if shorter banner is required."
listener="toggle.checkboxShorterBanner"
name="./enableBanner"
text="Shorter Banner"
uncheckedValue="false"
value="true"
defaultChecked="{Boolean}true"/>
and in SlingModel using it
@ValueMapValue
@Default(booleanValues = true)
private boolean enableBanner;
Sightly code
I want to add shortHeroClass if it is checked otherwise no
I can see the difference in html where it is coming as checked by default
<div class="coral-Form-fieldwrapper coral-Form-fieldwrapper--singleline"><label class="coral-Checkbox coral-Form-field">
<input type="checkbox" name="./shorterBanner" value="true" data-validation="" checked="" class="coral-Checkbox-input" data-listener="toggle.checkboxShorterBanner">
where it is not coming as checked by default, checked="" is not coming in html
<div class="coral-Form-fieldwrapper coral-Form-fieldwrapper--singleline"><label class="coral-Checkbox coral-Form-field">
<input type="checkbox" name="./enableBanner" value="true" data-validation="" class="coral-Checkbox-input" data-listener="toggle.checkboxShorterBanner">
But on this page if I am dragging dropping this component, then it is showing checkbox checked by default
I also want to show hide tab based on checkbox selection